<pre><codeclass="python language-python hljs"><list> = <str>.split() <spanclass="hljs-comment"># Splits on one or more whitespace characters.</span>
<list> = <str>.split(sep=<spanclass="hljs-keyword">None</span>, maxsplit=<spanclass="hljs-number">-1</span>) <spanclass="hljs-comment"># Splits on 'sep' str at most 'maxsplit' times.</span>
<list> = <str>.splitlines(keepends=<spanclass="hljs-keyword">False</span>) <spanclass="hljs-comment"># Splits on line breaks. Keeps them if 'keepends'.</span>
<list> = <str>.splitlines(keepends=<spanclass="hljs-keyword">False</span>) <spanclass="hljs-comment"># Splits on \n,\r,\r\n. Keeps them if 'keepends'.</span>
<str> = <str>.join(<coll_of_strings>) <spanclass="hljs-comment"># Joins elements using string as separator.</span>
</code></pre>
<pre><codeclass="python language-python hljs"><bool> = <sub_str><spanclass="hljs-keyword">in</span><str><spanclass="hljs-comment"># Checks if string contains a substring.</span>
@ -1526,15 +1526,15 @@ value = args.<name>
<pre><codeclass="python language-python hljs">os.chdir(<path>) <spanclass="hljs-comment"># Changes current working directory.</span>
os.mkdir(<path>, mode=<spanclass="hljs-number">0o777</span>) <spanclass="hljs-comment"># Creates a directory. Mode is in octal.</span>
</code></pre>
<pre><codeclass="python language-python hljs">shutil.copy(from, to) <spanclass="hljs-comment"># Copies the file.</span>
shutil.copytree(from, to) <spanclass="hljs-comment"># Copies the directory.</span>
<pre><codeclass="python language-python hljs">shutil.copy(from, to) <spanclass="hljs-comment"># Copies the file. 'to' can be a directory.</span>
shutil.copytree(from, to) <spanclass="hljs-comment"># Copies the directory. 'to' must not exist.</span>
</code></pre>
<pre><codeclass="python language-python hljs">os.rename(from, to) <spanclass="hljs-comment"># Renames or moves the file or directory.</span>
<pre><codeclass="python language-python hljs">os.rename(from, to) <spanclass="hljs-comment"># Renames/moves the file or directory.</span>
os.replace(from, to) <spanclass="hljs-comment"># Same, but overwrites 'to' if it exists.</span>
</code></pre>
<pre><codeclass="python language-python hljs">os.remove(<path>) <spanclass="hljs-comment"># Deletes the file.</span>
os.rmdir(<path>) <spanclass="hljs-comment"># Deletes the empty directory.</span>
shutil.rmtree(<path>) <spanclass="hljs-comment"># Deletes the non-empty directory.</span>
shutil.rmtree(<path>) <spanclass="hljs-comment"># Deletes the directory.</span>
</code></pre>
<div><h3id="shellcommands">Shell Commands</h3><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> os