I have two files.
/a/a.py
and /b/b.py
In /b/b.py
, I have a func foo()
.
In /a/a.py
, I imported the func foo()
.
I want to add a line in foo()
to print the file path which imported and used this func.
In this case, /a/a.py
I tried to use print(__file__)
but it only shows the path of /b/b.py
Is there any package that works for this?