如何将print的输出保存为文本文件

在每个print后的括号里加上 file = f,例如:python f = open("output.txt", "w") print(img,file = f) f.close() 这里能够不用手动建立output.txt,由于程序会自动建立code
相关文章
相关标签/搜索