from os.path import abspath
from inspect import getsourcefile
print("abspath(getsourcefile(lambda:0)) is ", abspath(getsourcefile(lambda:0)))
无论您想从哪里找到源文件,只需使用
abspath(getsourcefile(lambda:0))
from os.path import abspath
from inspect import getsourcefile
print("abspath(getsourcefile(lambda:0)) is ", abspath(getsourcefile(lambda:0)))
无论您想从哪里找到源文件,只需使用
abspath(getsourcefile(lambda:0))