python 解决pyinstaller打包后获取当前路径失败

640 阅读1分钟
if getattr(sys, 'frozen', False):
    path = os.path.dirname(sys.executable)
elif __file__:
    path = os.path.dirname(__file__)