Copy a file line by line in python

前端 未结 4 1564
半阙折子戏
半阙折子戏 2021-01-12 17:48

I am writing a python program to copy a file line by line into a new file. The code I have is below in which I am using a loop to copy the file line by line.

Howeve

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 18:26

    Writing line by line can be slow when working with large data. You can accelerate the read/write operations by reading/writing a bunch of lines all at once. Please refer to my answer to a similar question here

提交回复
热议问题