Say my directory looks like this
folder
⮑ file.py
⮑ class.py
In want to make a function in class.py that can return the filepath of the current file when it is executed in file.py.
I have tried __file__ and os.path.basename/dirname/abspath but they return the filepath of class.py when I want the filepath of file.py.
How can I get the filepath of file.py from class.py's function?