2024-09-30 10:28:43 发布
网友
我收到以下错误消息:
io.UnsupportedOperation: not readable
根据此代码:
f=open('namn.txt', 'w') namnnr=1 for rad in f.readlines(): print(str(namnnr)+namnnr) namnnr+=1 f.close()
为什么会这样?你知道吗
您正在传递'w'作为文件打开模式。'“w”的意思是“写”。用“r”表示“read”。你知道吗
您正在传递'w'作为文件打开模式。'“w”的意思是“写”。用“r”表示“read”。你知道吗
相关问题 更多 >
编程相关推荐