📜  如何在python代码示例中将字符串导出为txt文件

📅  最后修改于: 2022-03-11 14:45:17.210000             🧑  作者: Mango

代码示例1
text_file = open("sample.txt", "w")
n = text_file.write('Welcome to pythonexamples.org')
text_file.close()