<pre><codeclass="python language-python hljs"><file>.seek(<spanclass="hljs-number">0</span>) <spanclass="hljs-comment"># Moves to the start of the file.</span>
<file>.seek(offset) <spanclass="hljs-comment"># Moves 'offset' chars/bytes from the start.</span>
<file>.seek(<spanclass="hljs-number">0</span>, <spanclass="hljs-number">2</span>) <spanclass="hljs-comment"># Moves to the end of the file.</span>
<pre><codeclass="python language-python hljs"><str/bytes> = <file>.read(size=<spanclass="hljs-number">-1</span>) <spanclass="hljs-comment"># Reads 'size' chars/bytes or until EOF.</span>
<str/bytes> = <file>.readline() <spanclass="hljs-comment"># Returns a line.</span>
@ -1170,11 +1171,11 @@ value = args.<name>
<str/bytes> = next(<file>) <spanclass="hljs-comment"># Returns a line using buffer. Do not mix.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><file>.write(<str/bytes>) <spanclass="hljs-comment"># Writes a string or bytes object.</span>
<file>.writelines(<list>) <spanclass="hljs-comment"># Writes a list of strings or bytes objects.</span>
<file>.writelines(<coll.>)<spanclass="hljs-comment"># Writes a coll. of strings or bytes objects.</span>