How do I set up a timer as a subprocess?

Shitiz Bansal shitizb at yahoo.com
Thu Mar 10 11:51:04 EST 2005


import threading
def hello():
    print "hello, world"

t = threading.Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be
printed


--- Dfenestr8 <chrisdewinN0SPAM at yahoo.com.au> wrote:
> Hi.
> 
> Trying to set up a timer function for my irc bot,
> which uses the python
> irclib.py.
> 
> If I use time.sleep(20), it tends to freeze up the
> bot completely for 20
> secs. That's not what I want though! I want the
> program to wait 20 secs,
> then perform another function, but in the meantime
> be able to accept other
> commands.
> 
> How do I do that? 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 



More information about the Python-list mailing list