摘自 https://blog.csdn.net/ckq707718837/article/details/121276357
with open(cls_path,'w') as f1:
#方法一:
for line in cls_labelList:
f1.write(line+'\n')
#方法二:
lists=[line+"\n" for line in lists]
f1.writelines(lists)
#方法三:
f1.write('\n'.join(lists))
版权归原作者 瑾怀轩 所有, 如有侵权,请联系我们删除。