#文件写模式f=open('a.txt','w',encoding='utf-8')#文件写f.write('11111\n')f.write('2222\n')f.write('3333\n4444\n')#文件写多行f.writelines(['a\n','b\n','c\n'])#关闭f.close()