Idea: Use the replace method of the string to modify it.
str.repalce('old char','new char')。
str=r'E:\doc\Documents\360截图'
sep= '\\'
path = str.replace(sep, r'/')
# 结果是:'E:/doc/Documents/360截图'
Idea: Use the replace method of the string to modify it.
str.repalce('old char','new char')。
str=r'E:\doc\Documents\360截图'
sep= '\\'
path = str.replace(sep, r'/')
# 结果是:'E:/doc/Documents/360截图'