File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -964,18 +964,22 @@ Pathlib
964
964
965
965
``` python
966
966
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>'
970
970
```
971
971
972
972
``` 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.
976
973
< bool > = < Path> .exists()
974
+ < bool > = < Path> .is_file()
977
975
< 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.
979
983
```
980
984
981
985
``` python
You can’t perform that action at this time.
0 commit comments