with open(‘test3.txt‘,‘w‘,encoding=‘utf-8‘) as f: print(‘this is test3.txt‘,file=f) #用print 输出到文件
2019年12月16日 明日科技 python语言基础
原文:https://www.cnblogs.com/python1988/p/12051372.html