Ghanshyam Savaliya
Ghanshyam Savaliya

Reputation: 608

How to Hide black screen while executing Executable file which we have generated through pyinstaller?

I have created a Executable file through pyinstaller. To generate Executable file I am using below command in virtual environment:

pyinstaller --onefile imp.py

Note: the Executable file contains Tkinter code

Once I click on the file to execute it, It popup with 2 screen, one is Black Screen and Other is Tkinter Screen (Refer below Image for the same)

Output for Executing imp.exe file as below Image:

enter image description here

Question: How can I hide the black screen which you can see in above Image? (It should not be visible when I execute the Executable file, I want to showcase only tkinter Window)

Thanks for replies. It will be very helpful for me if someone guide me on this.

Upvotes: 3

Views: 6448

Answers (1)

ruohola
ruohola

Reputation: 24018

You need to add the --noconsole flag to your pyinstaller command:

pyinstaller --onefile --noconsole imp.py

This will make so that the black terminal window will never appear.

Upvotes: 5

Related Questions