Pyinstaller 加载启动画面

Pyinstaller loading splash screen

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

来自 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()