当前位置:主页 > 软件编程 > Python代码 >
时间:2021-04-28 08:06:46 | 栏目:Python代码 | 点击:次
如下所示:
#!/usr/bin/python #-*- coding: utf-8 -*- fin=open('add_1.txt') a=fin.readlines() # print a fout=open('ok.txt','w') b=''.join(a[:3]) fout.write(b)
删除3行后的其他行。