To save the content of the print output to a txt file, you need to use Python's open() and write() functions: f = open("filename.txt", "w") f.write("content to be written" ) f. close()
Python saves the output of print to a txt file
Guess you like
Origin blog.csdn.net/weixin_42588555/article/details/129576952
Ranking