I\'ve found that I\'m using this pattern a lot :
os.path.join(os.path.dirname(__file__), file_path)
so I\'ve decided to put in a function i
This should do it:
inspect.getfile(sys._getframe(1))
sys._getframe(1) gets the caller frame, inspect.getfile(...) retrieves the filename.