输出的时候将print换成写入文件方式
fout = open("a.txt", "w+", encoding="utf-8")fout.write("this string will be output in txt.")