python get exact location of current file code example Example: python get path of current file import pathlib pathlib.Path(__file__).parent.absolute()