实例: list = [1,2,3,4] with open('list.txt','w') as fp: [fp.write(str(item)+'\n') for item in list] fp.close() 结果: 有问题可留言。。。。