📜  python读取文件删除第一行 - Python代码示例

📅  最后修改于: 2022-03-11 14:45:46.117000             🧑  作者: Mango

代码示例1
with open('file.txt', 'r') as fin:
    data = fin.read().splitlines(True)
with open('file.txt', 'w') as fout:
    fout.writelines(data[1:])