How to delete the first line of a text file?

前端 未结 8 2044
醉梦人生
醉梦人生 2020-11-29 09:10

I have been searching online, but have not found any good solution.

Here is my text file:

[54, 95, 45, -97, -51, 84, 0, 32, -55, 14, 50, 54, 68, -3,          


        
8条回答
  •  我在风中等你
    2020-11-29 09:41

    You can do it much easier but simply stating what is the first line to be read:

        with open(filename, "r") as f:
            rows = f.readlines()[1:]
    

提交回复
热议问题