When we use Python packaged exe files, there is a black box behind each run, such as mine:
The graphical interface made by Tkinter is packaged into exe files. Every time it runs, there are black boxes. There are no black boxes in the software with graphical interface used by our computers.
So can you remove the black box? The answer is yes.
When we pack: if you specify Python files directly for pyinstaller packaging, you need to add — noconsole
For example: pyinstaller – F mycode. py — noconsole
You can also do this by pyinstaller – F – w mycode. py (- W is the cancel window)
When you repackage a file, you will find that there is only a graphical interface, no black box, and personal testing is effective.
Note: For non-graphical interfaces, command window execution is required. Do not use this function.
The above article solves the problem that Pyinstaller packaged exe files cancel DOS window (black box) is all the content that Xiaobian shares with you. I hope to give you a reference, and I hope you will support developpaer more.