我有一个像这样的textfile.txt:
First Line Second Line Third Line Fourth Line Fifth Line Sixth Line
如何删除最舒适的前三行和最后一行?
with open('textfile.txt') as old, open('newfile.txt', 'w') as new: lines = old.readlines() new.writelines(lines[3:-1])