import os
def GetScriptPath():
return os.path.realpath(__file__);
print(GetScriptPath());
from pathlib import Path
current_file: Path = Path(__file__).resolve()
import pathlib
pathlib.Path().resolve()
current_path: Path = Path(__file__).parent.resolve()
import inspect
inspect.getfile(<mdule name>)
this video might help: https://youtu.be/PzlQPNNt8T4?t=147
(video starts at 2:27)