files and directories
- absolute path(start from the root of our hard-disk)
- relative path(a path starting from the current directory)
Path class
- path.exists() return boolean value
- path.mkdir() create a new directory, return None
- path.rmdir()
- path.glob() search for files and pathes in the current directory
- argument defines a search pattern
- " * "means everything, all files and directories
- add an expension using " . "
from pathlib import Path
path = Path()
print(path.glob('*.py'))
returns a generator object
path = Path()
for file in path.glob('*.py'):
print(file)