Sys.exit() does not fully exit

Gary Herron gherron at islandtraining.com
Sun Feb 17 17:07:52 CET 2008


Christian Heimes wrote:
> Harlin Seritt wrote:
>   
>> When x is typed, everything does shut down but the main script never
>> fully ends. Is there any way to get it to quit?
>>     
>
> You don't need threads. Please use the subprocess module instead of
> threads + os.system.
>
> Christian
>   
That's a good answer.  However, it you *do* want threads, and you don't 
want the main thread to wait for the threads to quit, you can make the 
threads "daemon threads".  See setDaemon method on Thread objects in the 
threading module.

Gary Herron




More information about the Python-list mailing list