|
|
@ -1486,12 +1486,12 @@ value = args.<name> |
|
|
|
<str> = <Path>.suffix <span class="hljs-comment"># Returns final component's extension.</span> |
|
|
|
<tup.> = <Path>.parts <span class="hljs-comment"># Returns all components as strings.</span> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><str> = str(<Path>) <span class="hljs-comment"># Returns Path as a string.</span> |
|
|
|
<file> = open(<Path>) <span class="hljs-comment"># Opens the file and returns a file object.</span> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><iter> = <Path>.iterdir() <span class="hljs-comment"># Returns dir contents as Path objects.</span> |
|
|
|
<iter> = <Path>.glob(<span class="hljs-string">'<pattern>'</span>) <span class="hljs-comment"># Returns Paths matching the wildcard pattern.</span> |
|
|
|
</code></pre> |
|
|
|
<pre><code class="python language-python hljs"><str> = str(<Path>) <span class="hljs-comment"># Returns path as a string.</span> |
|
|
|
<file> = open(<Path>) <span class="hljs-comment"># Opens the file and returns a file object.</span> |
|
|
|
</code></pre> |
|
|
|
<div><h2 id="oscommands"><a href="#oscommands" name="oscommands">#</a>OS Commands</h2><div><h3 id="filesanddirectories">Files and Directories</h3><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 <a href="#exceptions-1">subclasses</a>.</strong></li> |
|
|
|