Detect console close

Peter Hansen peter at engcorp.com
Mon May 16 04:35:07 EDT 2005


new pip wrote:
> In Windows, when I double click on my .py file, the program runs with
> a console. How can I detect when the console is closed? Any code
> samples are appreciated.

When the console has closed, your program has already exited, if I 
understand you correctly (which isn't certain: the question seems 
vague).  How would you expect to "detect" this with code if your code is 
no longer running?

Maybe you should also explain what you're really trying to accomplish, 
as there maybe other ways of doing it, or other solutions to your problem.

-Peter



More information about the Python-list mailing list