python使用csv读写文件出错UnicodeDecodeError: 'ascii' codec can't decode
源代码
with open('/Users/aaaa/Documents/images/info.csv') as csvfile:
出错信息:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 69: ordinal not in range(128)
解决方法
改为下面这样:
with open('/Users/aaaa/Documents/images/info.csv', 'r', encoding='utf8') as csvfile: