python3读取csv文件内容报错:ValueError: binary mode doesn't take an encoding argument 原因!
2019-08-21 17:06
2326 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_41752647/article/details/99976720
因为"rb" 以二进制读方式打开,只能读文件 , 如果文件不存在,会发生异常 ,而csv里面是以字符串str形式的,所以把"rb"改成"r"就可以了
相关文章推荐
- 手把手教你 python读取文件报错:ValueError encoding must be one of 'utf_8', 'big5', or 'gbk'.
- python读取csv文件是报错_csv.Error: iterator should return strings, not bytes (did you open the file in text
- python 对csv文件的列的内容读取
- Python读取CSV文件:UnicodeDecodeError: 'gbk' codec can't decode byte 0xba ....illegal multibyte sequence
- 【Python】按行读取文件、IOError: [Errno 22] invalid mode ('a+') or filename,处理文件的换行符
- 【Python配置】TypeError: parse() got an unexpected keyword argument 'transport_encoding'
- Python3 pandas read_csv 读取txt文件报错:IOError: Initializing from file failed
- python 2.7版本解决TypeError: 'encoding' is an invalid keyword argument for this function
- python读取.csv文件时出现OSError: Initializing from file failed
- Python webdriver 读取本地csv文件中数据 提示:IOError: [Errno 2] No such file or directory
- python实现对csv文件的列的内容读取
- python--读取文件内容
- Python中逐行读取文件内容的办法
- Python的文件输入输出,如何追加内容,读取内容,添加内容
- PHP读取csv文件的内容
- 使用EmbeddedValueResolverAware读取配置文件内容
- python 把内容写入csv文件
- python 读取目录下csv文件并绘制曲线v111的方法
- 测试sq3数据库,读取数据库把内容输出到csv文件,附上输出到excel方法
- Python 3.6 读取并操作文件内容