Solve the problem of Pyinstaller packing EXE file canceling DOS window (black box)


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.

Recommended Today

Big data Hadoop — spark SQL + spark streaming

catalogue 1、 Spark SQL overview 2、 Sparksql version 1) Evolution of sparksql 2) Comparison between shark and sparksql 3)SparkSession 3、 RDD, dataframes and dataset 1) Relationship between the three 1)RDD 1. Core concept 2. RDD simple operation 3、RDD API 1)Transformation 2)Action 4. Actual operation 2)DataFrames 1. DSL style syntax operation 1) Dataframe creation 2. SQL […]