python语法错误 SyntaxError: EOL while scanning string literal

SyntaxError: EOL while scanning string literal

错误原因是,字符串以 \ 结尾 或者字符串缺少引号

img = cv2.imread('E:\mystudy\churui\30\' + str(i) + ".bmp", 0)

代码错误,应该改为

img = cv2.imread('E:\\mystudy\\churui\\30\\' + str(i) + ".bmp", 0)

 

你可能感兴趣的:(python,SyntaxError:,EOL,while,scannin,python语法错误)