Python CLI script resources
(, en)
Get path of curently executing file
from inspect import getsourcefile
from os.path import abspath
file_path = abspath(getsourcefile(lambda:0))
file_stem = Path(getsourcefile(lambda: 0)).stem
How do I get the path of the current executed file in Python? - Stack Overflow