Browse Source

Paths

pull/122/head
Jure Šorn 2 years ago
parent
commit
c6564ccd73
2 changed files with 6 additions and 6 deletions
  1. 4
      README.md
  2. 8
      index.html

4
README.md

@ -1655,7 +1655,7 @@ from pathlib import Path
```python
<Path> = Path(<path> [, ...]) # Accepts strings, Paths and DirEntry objects.
<Path> = <path> / <path> [/ ...] # One of the two paths must be a Path object.
<Path> = <path> / <path> [/ ...] # First or second path must be a Path object.
```
```python
@ -1674,7 +1674,7 @@ from pathlib import Path
```
```python
<iter> = <Path>.iterdir() # Returns dir contents as Path objects.
<iter> = <Path>.iterdir() # Returns directory contents as Path objects.
<iter> = <Path>.glob('<pattern>') # Returns Paths matching the wildcard pattern.
```

8
index.html

@ -54,7 +54,7 @@
<body>
<header>
<aside>February 17, 2022</aside>
<aside>February 27, 2022</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</header>
@ -1400,7 +1400,7 @@ value = args.&lt;name&gt;
</code></pre></div>
<pre><code class="python language-python hljs">&lt;Path&gt; = Path(&lt;path&gt; [, ...]) <span class="hljs-comment"># Accepts strings, Paths and DirEntry objects.</span>
&lt;Path&gt; = &lt;path&gt; / &lt;path&gt; [/ ...] <span class="hljs-comment"># One of the two paths must be a Path object.</span>
&lt;Path&gt; = &lt;path&gt; / &lt;path&gt; [/ ...] <span class="hljs-comment"># First or second path must be a Path object.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;Path&gt; = Path() <span class="hljs-comment"># Returns relative cwd. Also Path('.').</span>
&lt;Path&gt; = Path.cwd() <span class="hljs-comment"># Returns absolute cwd. Also Path().resolve().</span>
@ -1413,7 +1413,7 @@ value = args.&lt;name&gt;
&lt;str&gt; = &lt;Path&gt;.suffix <span class="hljs-comment"># Returns final component's extension.</span>
&lt;tup.&gt; = &lt;Path&gt;.parts <span class="hljs-comment"># Returns all components as strings.</span>
</code></pre>
<pre><code class="python language-python hljs">&lt;iter&gt; = &lt;Path&gt;.iterdir() <span class="hljs-comment"># Returns dir contents as Path objects.</span>
<pre><code class="python language-python hljs">&lt;iter&gt; = &lt;Path&gt;.iterdir() <span class="hljs-comment"># Returns directory contents as Path objects.</span>
&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>
</code></pre>
<pre><code class="python language-python hljs">&lt;str&gt; = str(&lt;Path&gt;) <span class="hljs-comment"># Returns path as a string.</span>
@ -2884,7 +2884,7 @@ $ pyinstaller script.py --add-data '&lt;path&gt;:.' <span class="hljs-comment">
<footer>
<aside>February 17, 2022</aside>
<aside>February 27, 2022</aside>
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
</footer>

Loading…
Cancel
Save