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