python path directory code example
Example 1: get path to current directory python
import os
os.path.abspath(os.getcwd())
Example 2: python get base directory
import os
os.path.dirname(os.path.realpath(__file__))
Example 3: python file location path
import os
print('getcwd: ', os.getcwd())
print('__file__: ', __file__)