From_file=open('D:\\python\\A\\tianqi.txt') f=open('niuniu1.txt','w') count=0 for each_line in From_file: f.writelines(','+each_line) count+=1 f.close() From_file.close() print('文件中总共有:%d行'%count)
Python:文件中每行开头加一个逗号‘,’
最新推荐文章于 2023-07-15 20:18:37 发布