Skip to content

Commit ae3d9c7

Browse files
committed
Pathlib
1 parent 28c49c3 commit ae3d9c7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -964,18 +964,22 @@ Pathlib
964964

965965
```python
966966
from pathlib import Path
967-
pwd = Path()
968-
<Path> = Path('<path>' [, '<path>', <Path>, ...])
969-
<Path> = <Path> / '<dir>' / '<file>'
967+
pwd = Path()
968+
<Path> = Path('<path>' [, '<path>', <Path>, ...])
969+
<Path> = <Path> / '<dir>' / '<file>'
970970
```
971971

972972
```python
973-
<iter> = <Path>.iterdir() # Returns all files in a dir.
974-
<iter> = <Path>.glob('<pattern>') # Returns all matches.
975-
<Path> = <Path>.resolve() # Makes path absolute.
976973
<bool> = <Path>.exists()
974+
<bool> = <Path>.is_file()
977975
<bool> = <Path>.is_dir()
978-
<file> = <Path>.open()
976+
<iter> = <Path>.iterdir()
977+
```
978+
979+
```python
980+
<iter> = <Path>.glob('<pattern>') # Returns all matches.
981+
<Path> = <Path>.resolve() # Makes path absolute.
982+
<file> = <Path>.open() # Opens file.
979983
```
980984

981985
```python

0 commit comments

Comments
 (0)