立即学习:https://edu.youkuaiyun.com/course/play/5814/109548?utm_source=blogtoedu
fp=open('xxx.txt',w)
a=['a','b','c']
fp.writelines(a)
fp.close
这样通过使用writelines只会把列表中的内容添加进去,不会换行,想要换行需要在每一个数据后面加\n
立即学习:https://edu.youkuaiyun.com/course/play/5814/109548?utm_source=blogtoedu
fp=open('xxx.txt',w)
a=['a','b','c']
fp.writelines(a)
fp.close
这样通过使用writelines只会把列表中的内容添加进去,不会换行,想要换行需要在每一个数据后面加\n