How to close the DOS Shell when starting a python script

M

m.errami

Hello all.
I know the question will seem stupid but googling it gives me only
stuff I don't care about.
So the question is the following:
When I start a python script containing a wxApp under windows XP, I
double click , my program opens and a background DOS shell also opens.
Is there any way to prevent the DOS from opening?
What is weird is that when I create a freezed version (an executable),
then the DOS shell doens't open anymore.
Any clues?
Thanks for your help
M.E.
 
P

Paddy

Hello all.
I know the question will seem stupid but googling it gives me only
stuff I don't care about.
So the question is the following:
When I start a python script containing a wxApp under windows XP, I
double click , my program opens and a background DOS shell also opens.
Is there any way to prevent the DOS from opening?
What is weird is that when I create a freezed version (an executable),
then the DOS shell doens't open anymore.
Any clues?
Thanks for your help
M.E.

Rename the .py file with extension .pyw.
- Paddy.
 
W

Wildemar Wildenburger

Paddy said:
Rename the .py file with extension .pyw.
- Paddy.
To elaborate: This works because, by default, .py files are associated
with python.exe and .pyw files are associated with pythonw.exe, the
latter not opening a console window.
You can actually run a .py file with pythonw.exe without opening a console.

wildemar
 
M

m.errami

Wildemar said:
To elaborate: This works because, by default, .py files are associated
with python.exe and .pyw files are associated with pythonw.exe, the
latter not opening a console window.
You can actually run a .py file with pythonw.exe without opening a console.

wildemar


Paddy and Wildemar. Thank you. That was easy!

M.E.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top