l have two scripts:
main.py
import package.py
package.py
import os
print(os.path.basename(_file_))
My expected output is main.py, but I'm getting package.py.
So how can l get the running script's filename in a package script?
extra description:
The truth is, I have a decorator function in package.py. It will generate a file at current path and named as the file's name who called it.
package.pyyou could just hard-code it (not saying there is no better solution).