[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: exiting threaded program?

Tim Golden

3/24/2010 11:08:00 AM

On 24/03/2010 11:04, Alex Hall wrote:
> A daemon... Good idea, and that makes more sense for what the thread
> does anyway; it is just a timer, updating a variable by contacting a
> server every hour. By the way, just what is the difference between
> user32.PostQuitMessage (0) and sys.exit()?

The former is a notification to a Windows message loop (something
most Python programs don't have) that it should exit; the latter
is a system call to exit the running program -- after any message
loops have completed if applicable.

BTW if you're running a Windows message loop anyway, you could just
use Windows timers, catch the WM_TIMER message and avoid the complication
of threads. Just an idea.

TJG