# coding:utf-8 with open(‘dist_1.txt‘,‘r‘,encoding= ‘utf-8‘) as f1,open(‘dist_2.txt‘,‘w‘,encoding= ‘utf-8‘) as f2: i=0 for line in f1: i+=1 if i%10==0: f2.write(line)
时间: 2024-11-05 18:27:55
# coding:utf-8 with open(‘dist_1.txt‘,‘r‘,encoding= ‘utf-8‘) as f1,open(‘dist_2.txt‘,‘w‘,encoding= ‘utf-8‘) as f2: i=0 for line in f1: i+=1 if i%10==0: f2.write(line)