@@ -964,31 +964,31 @@ 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
- < bool > = < Path> .exists()
974
- < bool > = < Path> .is_file()
975
- < bool > = < Path> .is_dir()
976
- < iter > = < Path> .iterdir()
973
+ < bool > = < Path> .exists()
974
+ < bool > = < Path> .is_file()
975
+ < bool > = < Path> .is_dir()
976
+ < iter > = < Path> .iterdir()
977
977
```
978
978
979
979
``` python
980
- < iter > = < Path> .glob(' <pattern>' ) # Returns all matches.
981
- < Path> = < Path> .resolve() # Makes path absolute.
982
- < file > = < Path> .open() # Opens file.
980
+ < iter > = < Path> .glob(' <pattern>' ) # Returns all matches.
981
+ < Path> = < Path> .resolve() # Makes path absolute.
982
+ < file > = < Path> .open() # Opens file.
983
983
```
984
984
985
985
``` python
986
- < str > = str (< Path> ) # Returns path as string.
987
- < str > = < Path> .name # Final component.
988
- < str > = < Path> .stem # Final component without extension.
989
- < str > = < Path> .suffix # Final component's extension.
990
- < Path> = < Path> .parent # Path without final component.
991
- < tuple > = < Path> .parts # All components as strings.
986
+ < str > = str (< Path> ) # Returns path as string.
987
+ < str > = < Path> .name # Final component.
988
+ < str > = < Path> .stem # Final component without extension.
989
+ < str > = < Path> .suffix # Final component's extension.
990
+ < Path> = < Path> .parent # Path without final component.
991
+ < tup. > = < Path> .parts # All components as strings.
992
992
```
993
993
994
994
0 commit comments