<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'help=<str>'</span></code> to set argument description that will be displayed in help message.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'default=<el>'</span></code> to set the default value.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'type=FileType(<mode>)'</span></code> for files. Accepts 'encoding', but 'newline' is always None.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'type=FileType(<mode>)'</span></code> for files. Accepts 'encoding', but not 'newline'.</strong></li>
</ul>
<div><h2id="open"><ahref="#open"name="open">#</a>Open</h2><p><strong>Opens the file and returns a corresponding file object.</strong></p><pre><codeclass="python language-python hljs"><file> = open(<path>, mode=<spanclass="hljs-string">'r'</span>, encoding=<spanclass="hljs-keyword">None</span>, newline=<spanclass="hljs-keyword">None</span>)
os.rmdir(<path>) <spanclass="hljs-comment"># Deletes the empty directory.</span>
shutil.rmtree(<path>) <spanclass="hljs-comment"># Deletes the directory.</span>
</code></pre>
<ul>
<li><strong>Paths can be either strings, Paths or DirEntry objects.</strong></li>
<li><strong>Functions report OS related errors by raising either OSError or one of its <ahref="#exceptions-1">subclasses</a>.</strong></li>
</ul>
<div><h3id="shellcommands">Shell Commands</h3><pre><codeclass="python language-python hljs"><pipe> = os.popen(<spanclass="hljs-string">'<command>'</span>) <spanclass="hljs-comment"># Executes command in sh/cmd and returns its stdout pipe.</span>
<str> = <pipe>.read(size=<spanclass="hljs-number">-1</span>) <spanclass="hljs-comment"># Reads 'size' chars or until EOF. Also readline/s().</span>
<int> = <pipe>.close() <spanclass="hljs-comment"># Closes the pipe. Returns None on success, int on error.</span>