<p>基本的是我需要以每行为基础处理4gig文本文件。在</p>
<p>在f中使用.readline()或for line对内存很好,但是IO需要很长时间。我想用屈服点之类的东西,但那(我想)会砍掉线条。在</p>
<p><strong>可能的答案:</strong></p>
^{1}$
<blockquote>
<pre><code>Read until EOF using readline() and return a list containing the lines
</code></pre>
<p>thus read. If the optional sizehint
argument is present, instead of
reading up to EOF, whole lines
totalling approximately sizehint bytes
(possibly after rounding up to an
internal buffer size) are read.
Objects implementing a file-like
interface may choose to ignore
sizehint if it cannot be implemented,
or cannot be implemented efficiently.</p>
</blockquote>
<p>没想到你能做到!在</p>