You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: index.html
+4-3Lines changed: 4 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1162,19 +1162,20 @@ <h3 id="modes">Modes</h3>
1162
1162
<h3id="file">File</h3>
1163
1163
<pre><codeclass="python language-python hljs"><file>.seek(<spanclass="hljs-number">0</span>) <spanclass="hljs-comment"># Moves to the start of the file.</span>
1164
1164
<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>
1168
1169
<str/bytes> = <file>.readline() <spanclass="hljs-comment"># Returns a line.</span>
1169
1170
<list> = <file>.readlines() <spanclass="hljs-comment"># Returns a list of lines.</span>
1170
1171
<str/bytes> = next(<file>) <spanclass="hljs-comment"># Returns a line using buffer. Do not mix.</span>
1171
1172
</code></pre>
1172
1173
<pre><codeclass="python language-python hljs"><file>.write(<str/bytes>) <spanclass="hljs-comment"># Writes a string or bytes object.</span>
1173
-
<file>.writelines(<list>) <spanclass="hljs-comment"># Writes a list of strings or bytes objects.</span>
1174
+
<file>.writelines(<coll.>) <spanclass="hljs-comment"># Writes a coll. of strings or bytes objects.</span>
0 commit comments