python 之 readline

来源:互联网 发布:淘宝打假怎么赚钱 编辑:程序博客网 时间:2024/05/17 22:09

What if we want to read from a file line by line, rather than pulling the entire file in at once. Thankfully, Python includes a readline() function that does exactly that.

If you open a file and call .readline() on the file object, you’ll get the first line of the file; subsequent calls to .readline() will return successive lines.

0 0