get path of current py file python code example
Example 1: python get path of current file
import pathlib
pathlib.Path(__file__).parent.absolute()
Example 2: get pyhton file path python
import os
os.path.realpath(__file__)
import pathlib
pathlib.Path(__file__).parent.absolute()
import os
os.path.realpath(__file__)