This question already has answers here:
How to hide console window in python?
(10 answers)
Closed 3 years ago.
My team and I implemented a game in Python using Pygame. Whenever the game is run, alongside the GUI there is an extra black window that opens alongside, a .exe window. Is there anyway to stop it from opening?
That is a command window, specifically one running python[Version Number].exe. To remove it simply change the scripts file extension to .pyw instead of .py, which changes the file type to the same thing [Python], but without the console window opening too.
So for example, script.py would become script.pyw
Related
This question already has answers here:
Run Python script without Windows console appearing
(11 answers)
Closed 5 years ago.
I am currently learning Python and I am working through a project in a book entitled Python Crash Course. The project involves developing a game called "Alien Invasion". In the process of running the game, it opens a 'window' area where the action occurs while keeping a command prompt shell open. At least to me, it seems tacky to have a command prompt shell open. I am thinking about developing some games and I want to have a professional look to them. Is there any way of automatically closing the command prompt shell close after a program compiled in Python has started?
If you are opening your program on IDLE, I believe it is not possible to not have the Shell window open as it is the main window for any sort of system output like errors. However, to make your game look more professional, you can use py2exe or py2app (Mac OS X). This will help you turn your program into an executable file that is also portable. Also, when you open your executable game window, there will be no Shell window opening.
This question already has answers here:
How do you run your own code alongside Tkinter's event loop?
(5 answers)
Closed 6 years ago.
I am currently working on making a program using tkinter that when pressing a button it opens the Python program, however I am having some problems with it. I have tried using os.system('filename.py'). That opens the file, but then crashes the GUI, making the user have to restart the GUI. I have also tried importing it as a module but that just does the same as when using os.system.
Can anyone possibly help me open a Python file in a completely new window/terminal?
The problem is filename.py will not be recognised by your os.
Instead of that use:
os.system('python filename.py')
This will successfully open your python file inside your GUI
Hope this helps
This question already has answers here:
How to hide console window in python?
(10 answers)
Closed 7 years ago.
I Have made small program from tkinter python. while i run this executable program i see black screen in background. i have attached images in this link
(https://drive.google.com/folderview?id=0B77Z7Ug9rVFFfmlpMXRfbTlUR1ZuQjVNbV9VWmMtZUk2amhrMHYxRWprSnJGdGh1TVdNbVU&usp=sharing)
I want to remove this black screen because i want to pack this program to .exe format without this black screen.
Waiting for proper answer.
You should save your script with .pyw extension.
This question already has answers here:
Hiding console window of Python GUI app with py2exe
(4 answers)
Closed 7 years ago.
I compiled a Python GUI program using py2exe, and it works, but when I run it the command prompt appears in addition to my program window. I have read that I should change the python.exe file to the pythonw.exe file, but there isn't even a Python.exe file in the dist folder to begin with. Compiling a .pyw version of the file also does not fix this. How would I prevent this from happening?
Duplicate
You didn't post any code (which you should do), but I suspect you're using "console" instead of "windows" in setup.py.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How can I hide the console window in a PyQt app running on Windows?
I have just started to explore wxPython for dialogs, and one thing that I've noticed so far is that every time I start a script (via double click or F5 in IDLE) I get the command prompt window in background, and then wx dialog appears.
Is there any way to remove that command prompt and just get the dialog I've made in wx?
Solved problem : replace extension from py to pyw and it works without the console in behind.