Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 838
Ghanshyam Savaliya Avatar asked Sep 13 '26 13:09

Ghanshyam Savaliya


1 Answers

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.

like image 175
ruohola Avatar answered Sep 15 '26 03:09

ruohola