<file> = open(<Path>) <spanclass="hljs-comment"># Opens a file and returns file object.</span>
</code></pre>
<div><h2id="commandexecution"><ahref="#commandexecution"name="commandexecution">#</a>Command Execution</h2><div><h3id="filesanddirectories">Files and Directories</h3><ul>
<li><strong>Paths can be either strings or Path objects.</strong></li>
<li><strong>Paths can be either strings, Paths or DirEntry objects.</strong></li>
<li><strong>All exceptions are either 'OSError' or its subclasses.</strong></li>
</ul><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">import</span> os
<str> = os.getcwd() <spanclass="hljs-comment"># Returns the current working directory.</span>