讲解对象:python实现桌面创建文本文档 作者:融水公子 rsgz 实战1:· 主句:open() close()函数 代码:· f=open(r'C:\Users\Administrator\Desktop\123.txt','w') # 写入的方式打开文件 print('床前明月光',file=f) print('疑是地上霜',file=f) f.close() 执行结果:大家看好本来桌面空空如也... 
sublime快捷键:Ctrl+B 执行代码之后 
卧槽,桌面上凭空生成了一个123文本文件 
打开文件看看: 
牛皮!!! 
|