When packaging, the console flashes. #9417
ghost
started this conversation in
Features & Development
Replies: 3 comments 1 reply
|
PyInstaller is a CLI program, so it makes little sense to force windowed interpreter for it - this way, you lose the build log. And respawning the process like that also hides the process' true exit status. |
0 replies
|
是的,但是多进程出现控制台闪烁的问题,目前这也是我的唯一解决方案 |
0 replies
|
But I'm sorry to tell you that this is not a CIL program, but it refers to the problem that the console black box flashes wildly under multi-process, understand? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello, everyone, I'm Xiao Zhi from China. I'm 19 years old. en, regarding the multi-process, single file and multi-file of pyinstaller, the black box of the console flashes. At present, I have found a solution for you, and I wonder if I can help you.
After my test, I found some souls in the process of writing code, and it only takes a few lines of code to solve this problem.
We can add this code in the main program entrance.
`if name == 'main':
The principle is as follows:
When python.exe is detected, the system will automatically switch to pythonw.exe, and then forcibly quit the process before the original start, and start a new process again to forcibly close the console.
But we need to pay attention to:
If you use the CIL startup mode, the detection is python.exe, and it is changed to pythonw.exe. At the same time, the graphical startup mode is changed to python.exe, so it will not work, because the environment does not match, and this is also to prevent the infinite restart caused by recursion.
All reactions