我有一个python脚本,我用pyinstaller转换。
pyinstaller -F "myscript.py" # it's the command I used
例如,myscript.PY执行一些命令来检索路径的变量:
path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # this finds the path of the script
elements = os.listdir(path) # this find the files in "path"
但是当我运行myscript.EXE时,它会在转换时找到元素,而不是我POST POST LOCATED myscript.EXE的路径元素。
有解决方法吗?我该怎么办?