84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
怎么使用python实现文件路径和url相互转换?
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.
具体实现方法如下:
import urllib pathname = 'path/to/file/or/folder/' url = urllib.pathname2url(pathname) pathname = urllib.url2pathname(url) print pathname
运行结果如下:
path\to\file\or\folder\
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.
具体实现方法如下:
运行结果如下: