File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -1593,14 +1593,14 @@ from pathlib import Path
1593
1593
```
1594
1594
1595
1595
``` python
1596
- < Path> = Path() # Or: Path('.')
1597
- < Path> = Path.cwd() # Returns the absolute cwd.
1598
- < Path> = < Path> .resolve() # Returns the absolute Path without symlinks.
1599
- < Path> = < Path> .parent # Returns Path without final component.
1596
+ < Path> = Path() # Returns relative cwd. Also Path('.').
1597
+ < Path> = Path.cwd() # Returns absolute cwd. Also Path().resolve().
1598
+ < Path> = < Path> .resolve() # Returns absolute Path without symlinks.
1600
1599
```
1601
1600
1602
1601
``` python
1603
- < str > = < Path> .name # Returns final component.
1602
+ < Path> = < Path> .parent # Returns Path without final component.
1603
+ < str > = < Path> .name # Returns final component as string.
1604
1604
< str > = < Path> .stem # Returns final component without extension.
1605
1605
< str > = < Path> .suffix # Returns final component's extension.
1606
1606
< tup.> = < Path> .parts # Returns all components as strings.
Original file line number Diff line number Diff line change 1464
1464
< pre > < code class ="python language-python hljs "> <Path> = Path(<path> [, ...]) < span class ="hljs-comment "> # Accepts strings, Paths and DirEntry objects.</ span >
1465
1465
<Path> = <path> / <path> [/ ...] < span class ="hljs-comment "> # One of the paths must be a Path object.</ span >
1466
1466
</ code > </ pre >
1467
- < pre > < code class ="python language-python hljs "> <Path> = Path() < span class ="hljs-comment "> # Or: Path('.')</ span >
1468
- <Path> = Path.cwd() < span class ="hljs-comment "> # Returns the absolute cwd.</ span >
1469
- <Path> = <Path>.resolve() < span class ="hljs-comment "> # Returns the absolute Path without symlinks.</ span >
1470
- <Path> = <Path>.parent < span class ="hljs-comment "> # Returns Path without final component.</ span >
1467
+ < pre > < code class ="python language-python hljs "> <Path> = Path() < span class ="hljs-comment "> # Returns relative cwd. Also Path('.').</ span >
1468
+ <Path> = Path.cwd() < span class ="hljs-comment "> # Returns absolute cwd. Also Path().resolve().</ span >
1469
+ <Path> = <Path>.resolve() < span class ="hljs-comment "> # Returns absolute Path without symlinks.</ span >
1471
1470
</ code > </ pre >
1472
- < pre > < code class ="python language-python hljs "> <str> = <Path>.name < span class ="hljs-comment "> # Returns final component.</ span >
1471
+ < pre > < code class ="python language-python hljs "> <Path> = <Path>.parent < span class ="hljs-comment "> # Returns Path without final component.</ span >
1472
+ <str> = <Path>.name < span class ="hljs-comment "> # Returns final component as string.</ span >
1473
1473
<str> = <Path>.stem < span class ="hljs-comment "> # Returns final component without extension.</ span >
1474
1474
<str> = <Path>.suffix < span class ="hljs-comment "> # Returns final component's extension.</ span >
1475
1475
<tup.> = <Path>.parts < span class ="hljs-comment "> # Returns all components as strings.</ span >
You can’t perform that action at this time.
0 commit comments