module signal

Josef Meile jmeile at
Tue Oct 26 21:10:36 CEST 2004

Hi Klaus,

> What I am looking for is code with the following meaning:
> for n seconds try to do:
>     # any Python code may be inserted here
> print "bla"
> When the n seconds are over, Python should print "bla". It should not
> exit the program. How can this be done? 
It should work with a signal alarm; I don't know why it
doesn't. You could also try a Timer object from the
threading class; it's even easier than a signal alarm.


More information about the Python-list mailing list