2024-09-26 18:07:52 发布
网友
尝试输出到文本文件时出现以下错误: io.UNSUPPOREDOPERATION:不可写
感谢任何帮助。谢谢
f = open("google-searches.txt", "w+") for item in results: google_searches.write("%s\n" % item)
你应该写信
f = open("google-searches.txt", "w+") for item in results: f.write("%s\n" % item)
因为您打开的文件对象是f。
f
你的问题是你写错了文件。
您已经打开了f,因此您应该将f写入,而不是google_searches:
google_searches
你应该写信
因为您打开的文件对象是
f
。你的问题是你写错了文件。
您已经打开了
f
,因此您应该将f
写入,而不是google_searches
:相关问题 更多 >
编程相关推荐