Detect console close

new pip newpip at gmail.com
Mon May 16 04:58:38 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
>-- 
>http://mail.python.org/mailman/listinfo/python-list

Hi,

Actually I want to do some clean up (or operation) before the program
actually exits. Is there any way to do that?

Thank you.



More information about the Python-list mailing list