数据分析师2017-10-01 00:17:33
How to use python to convert file path and url to each other? -PHP Chinese website Q&A-How to use python to convert file path and url to each other? -PHP Chinese website Q&A
Let’s take a look and learn.
伊谢尔伦2017-02-14 09:31:58
具体实现方法如下:
import urllib pathname = 'path/to/file/or/folder/' url = urllib.pathname2url(pathname) pathname = urllib.url2pathname(url) print pathname
运行结果如下:
path\to\file\or\folder\