anaconda
windows中和python读取文件格式有差别,windows中读取文件路径可以用\ ;
但是python中 \ 含有转义的意思,使用 \ 会被解读为转义字符,python的三种路径格式:
1.在路径面前加r,即保持字符原始值的意思:
im = cv2.imread(r'C:\users\1.txt')
2
替换为双反斜杠:
im = cv2.imread('C:\\users\\1.txt')
3
替换为正斜杠:
im = cv2
anaconda
windows中和python读取文件格式有差别,windows中读取文件路径可以用\ ;
但是python中 \ 含有转义的意思,使用 \ 会被解读为转义字符,python的三种路径格式:
1.在路径面前加r,即保持字符原始值的意思:
im = cv2.imread(r'C:\users\1.txt')
2
替换为双反斜杠:
im = cv2.imread('C:\\users\\1.txt')
3
替换为正斜杠:
im = cv2