读取文件:TypeError: an integer is required (got type str)

读取文件的时候报错:

Traceback (most recent call last):
File "D:Python35	estcsdn.py", line 46, in <module>
with open("test.txt","r","utf-8") as f:
TypeError: an integer is required (got type str)

 改成如下就好了

 with open("test.txt","r+","utf-8") as f: 

 问题解决。

原文地址:https://www.cnblogs.com/huangsxj/p/8520331.html