pathlib get current directory code example
Example 1: get path to current directory python
import os
os.path.abspath(os.getcwd())
Example 2: pathlib path get directory of current file
import pathlib
pathlib.Path(__file__).parent.absolute()
import os
os.path.abspath(os.getcwd())
import pathlib
pathlib.Path(__file__).parent.absolute()