Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9af8d0b

Browse files
committed
Paths
1 parent c6564cc commit 9af8d0b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ from os import scandir
16451645
<iter> = scandir(path='.') # Returns DirEntry objects located at path.
16461646
<str> = <DirEntry>.path # Returns whole path as a string.
16471647
<str> = <DirEntry>.name # Returns final component as a string.
1648-
<file> = open(<DirEntry>) # Opens the file and returns file object.
1648+
<file> = open(<DirEntry>) # Opens the file and returns a file object.
16491649
```
16501650

16511651
### Path Object
@@ -1680,7 +1680,7 @@ from pathlib import Path
16801680

16811681
```python
16821682
<str> = str(<Path>) # Returns path as a string.
1683-
<file> = open(<Path>) # Opens the file and returns file object.
1683+
<file> = open(<Path>) # Opens the file and returns a file object.
16841684
```
16851685

16861686

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@
13941394
<pre><code class="python language-python hljs">&lt;iter&gt; = scandir(path=<span class="hljs-string">'.'</span>) <span class="hljs-comment"># Returns DirEntry objects located at path.</span>
13951395
&lt;str&gt; = &lt;DirEntry&gt;.path <span class="hljs-comment"># Returns whole path as a string.</span>
13961396
&lt;str&gt; = &lt;DirEntry&gt;.name <span class="hljs-comment"># Returns final component as a string.</span>
1397-
&lt;file&gt; = open(&lt;DirEntry&gt;) <span class="hljs-comment"># Opens the file and returns file object.</span>
1397+
&lt;file&gt; = open(&lt;DirEntry&gt;) <span class="hljs-comment"># Opens the file and returns a file object.</span>
13981398
</code></pre>
13991399
<div><h3 id="pathobject">Path Object</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
14001400
</code></pre></div>
@@ -1417,7 +1417,7 @@
14171417
&lt;iter&gt; = &lt;Path&gt;.glob(<span class="hljs-string">'&lt;pattern&gt;'</span>) <span class="hljs-comment"># Returns Paths matching the wildcard pattern.</span>
14181418
</code></pre>
14191419
<pre><code class="python language-python hljs">&lt;str&gt; = str(&lt;Path&gt;) <span class="hljs-comment"># Returns path as a string.</span>
1420-
&lt;file&gt; = open(&lt;Path&gt;) <span class="hljs-comment"># Opens the file and returns file object.</span>
1420+
&lt;file&gt; = open(&lt;Path&gt;) <span class="hljs-comment"># Opens the file and returns a file object.</span>
14211421
</code></pre>
14221422
<div><h2 id="oscommands"><a href="#oscommands" name="oscommands">#</a>OS Commands</h2><div><h3 id="filesanddirectories">Files and Directories</h3><ul>
14231423
<li><strong>Paths can be either strings, Paths or DirEntry objects.</strong></li>

0 commit comments

Comments
 (0)