读取文件:TypeError: an integer is required (got type str)
生活随笔
收集整理的這篇文章主要介紹了
读取文件:TypeError: an integer is required (got type str)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
讀取文件的時候報錯:
Traceback (most recent call last): File "D:\Python35\test\csdn.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
總結
以上是生活随笔為你收集整理的读取文件:TypeError: an integer is required (got type str)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Tree Reconstruction
- 下一篇: JVM异常之:方法区溢出OutOfMem