r的作用和\\的作用是一样的,都是防止程序将\当做转义字符,正确的路径写法是:
1、
path = ‘D:/Desktop/daxue/shiyanshi/Project/OCR/images/dog.jpg’
2、
path = r'D:\Desktop\daxue\shiyanshi\Project\OCR\images\dog.jpg'
3、
path = ‘D:\\Desktop\\daxue\\shiyanshi\\Project\\OCR\\images\dog.jpg’
r的作用和\\的作用是一样的,都是防止程序将\当做转义字符,正确的路径写法是:
1、
path = ‘D:/Desktop/daxue/shiyanshi/Project/OCR/images/dog.jpg’
2、
path = r'D:\Desktop\daxue\shiyanshi\Project\OCR\images\dog.jpg'
3、
path = ‘D:\\Desktop\\daxue\\shiyanshi\\Project\\OCR\\images\dog.jpg’