do something every n seconds

Steve Holden steve at holdenweb.com
Thu Nov 25 10:05:49 EST 2010


On 11/25/2010 6:38 AM, Santiago Caracol wrote:
> Hello,
> 
> how can I do something (e.g. check if new files are in the working
> directory) every n seconds in Python?
> 
Look at the sched library, which was written to take care of
requirements like this. Use time.sleep() as your delay function and
time.time() as your time function.

regards
 Steve
-- 
Steve Holden           +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17       http://us.pycon.org/
See Python Video!       http://python.mirocommunity.org/
Holden Web LLC                 http://www.holdenweb.com/




More information about the Python-list mailing list