Browse Source

Pathlib

pull/22/head
Jure Šorn 5 years ago
parent
commit
2d18c617d7
1 changed files with 12 additions and 12 deletions
  1. 24
      README.md

24
README.md

@ -970,21 +970,21 @@ pwd = Path()
```
```python
<iter> = <Path>.iterdir() # Returns all files in a dir.
<iter> = <Path>.glob('<pattern>') # Returns all matches.
<Path> = <Path>.resolve() # Makes path absolute.
<bool> = <Path>.exists()
<bool> = <Path>.is_dir()
<file> = <Path>.open()
<iter> = <Path>.iterdir() # Returns all files in a dir.
<iter> = <Path>.glob('<pattern>') # Returns all matches.
<Path> = <Path>.resolve() # Makes path absolute.
<bool> = <Path>.exists()
<bool> = <Path>.is_dir()
<file> = <Path>.open()
```
```python
<str> = str(<Path>) # Returns path as string.
<str> = <Path>.name # Final component.
<str> = <Path>.stem # Final component without extension.
<str> = <Path>.suffix # Final component's extension.
<Path> = <Path>.parent # Path without final component.
<tuple> = <Path>.parts # All components as strings.
<str> = str(<Path>) # Returns path as string.
<str> = <Path>.name # Final component.
<str> = <Path>.stem # Final component without extension.
<str> = <Path>.suffix # Final component's extension.
<Path> = <Path>.parent # Path without final component.
<tuple> = <Path>.parts # All components as strings.
```

Loading…
Cancel
Save