1

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?

James N
  • 84
  • 2
  • 11
  • See this answer as well : https://stackoverflow.com/questions/764631/how-to-hide-console-window-in-python. If you're on Windows, the easiest way is to rename the script to end in `.pyw`, apparently. – Karl Reid Jun 15 '17 at 15:24

1 Answers1

2

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.

cookiedough
  • 3,552
  • 2
  • 26
  • 51