|
56 | 56 |
|
57 | 57 | <body> |
58 | 58 | <header> |
59 | | - <aside>May 1, 2025</aside> |
| 59 | + <aside>May 2, 2025</aside> |
60 | 60 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
61 | 61 | </header> |
62 | 62 |
|
|
1371 | 1371 | <list> = <file>.readlines() <span class="hljs-comment"># Returns a list of remaining lines.</span> |
1372 | 1372 | <str/bytes> = next(<file>) <span class="hljs-comment"># Returns a line using buffer. Do not mix.</span> |
1373 | 1373 | </code></pre> |
1374 | | -<pre><code class="python language-python hljs"><file>.write(<str/bytes>) <span class="hljs-comment"># Writes a string or bytes object.</span> |
| 1374 | +<pre><code class="python language-python hljs"><file>.write(<str/bytes>) <span class="hljs-comment"># Writes a string or bytes object to the file.</span> |
1375 | 1375 | <file>.writelines(<collection>) <span class="hljs-comment"># Writes a coll. of strings or bytes objects.</span> |
1376 | 1376 | <file>.flush() <span class="hljs-comment"># Flushes write buffer. Runs every 4096/8192 B.</span> |
1377 | 1377 | <file>.close() <span class="hljs-comment"># Closes the file after flushing write buffer.</span> |
|
1443 | 1443 | <div><h2 id="oscommands"><a href="#oscommands" name="oscommands">#</a>OS Commands</h2><pre><code class="python language-python hljs"><span class="hljs-keyword">import</span> os, shutil, subprocess |
1444 | 1444 | </code></pre></div> |
1445 | 1445 |
|
1446 | | -<pre><code class="python language-python hljs">os.chdir(<path>) <span class="hljs-comment"># Changes the current working directory.</span> |
| 1446 | +<pre><code class="python language-python hljs">os.chdir(<path>) <span class="hljs-comment"># Changes the current working directory (CWD).</span> |
1447 | 1447 | os.mkdir(<path>, mode=<span class="hljs-number">0o777</span>) <span class="hljs-comment"># Creates a directory. Permissions are in octal.</span> |
1448 | 1448 | os.makedirs(<path>, mode=<span class="hljs-number">0o777</span>) <span class="hljs-comment"># Creates all path's dirs. Also `exist_ok=False`.</span> |
1449 | 1449 | </code></pre> |
@@ -2940,7 +2940,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment |
2940 | 2940 |
|
2941 | 2941 |
|
2942 | 2942 | <footer> |
2943 | | - <aside>May 1, 2025</aside> |
| 2943 | + <aside>May 2, 2025</aside> |
2944 | 2944 | <a href="https://gto76.github.io" rel="author">Jure Šorn</a> |
2945 | 2945 | </footer> |
2946 | 2946 |
|
|
0 commit comments