Pyinstaller 加载启动画面

Sas*_*ern 9 python splash-screen pyinstaller

Pyinstaller 最近添加了一个启动画面选项(耶!),但启动画面在 exe 运行的整个过程中保持打开状态。我需要它,因为我的文件打开速度非常慢,我想警告用户不要关闭窗口。有没有办法让 gui 打开时关闭启动屏幕?

小智 5

来自 pyinstaller 文档:

import pyi_splash

# Update the text on the splash screen
pyi_splash.update_text("PyInstaller is a great software!")
pyi_splash.update_text("Second time's a charm!")

# Close the splash screen. It does not matter when the call
# to this function is made, the splash screen remains open until
# this function is called or the Python program is terminated.
pyi_splash.close()
Run Code Online (Sandbox Code Playgroud)