Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6e72dd

Browse files
committed
Pathlib
1 parent 71451cf commit f6e72dd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -977,18 +977,20 @@ pwd = Path()
977977
```
978978

979979
```python
980-
<iter> = <Path>.glob('<pattern>') # Returns all matches.
981-
<file> = <Path>.open() # Opens file.
982-
<Path> = <Path>.resolve() # Makes path absolute.
980+
<iter> = <Path>.glob('<pattern>') # Returns all matches.
983981
```
984982

985983
```python
984+
<Path> = <Path>.resolve() # Makes path absolute.
986985
<str> = str(<Path>) # Returns path as string.
986+
<tup.> = <Path>.parts # Returns all components as strings.
987+
```
988+
989+
```python
987990
<str> = <Path>.name # Final component.
988991
<str> = <Path>.stem # Final component without extension.
989992
<str> = <Path>.suffix # Final component's extension.
990993
<Path> = <Path>.parent # Path without final component.
991-
<tup.> = <Path>.parts # All components as strings.
992994
```
993995

994996

0 commit comments

Comments
 (0)