l have two scripts:
main.py
import package.py
package.py
import os
print(os.path.basename(_file_))
my excepted output is main.py
, but the fact is package.py
.
So how can l get the running script's file name in a package script?
extra description:
the truth is, l 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