我想打开一个文本文档。我收到错误TypeError: an integer is required (got type str)
这是我的代码
doc=open("bradley.txt","r","UTF-8")
doc.read(5)
print(doc.read(5))
答案 0 :(得分:0)
打开
doc=open("bradley.txt","r",encoding="UTF-8")
docs:https://docs.python.org/3/library/io.html?highlight=open#io.open