do something every n seconds

2010-11-25 Thread Santiago Caracol
Hello, how can I do something (e.g. check if new files are in the working directory) every n seconds in Python? Santiago -- http://mail.python.org/mailman/listinfo/python-list

Re: do something every n seconds

2010-11-25 Thread Alice Bevan–McGregor
how can I do something (e.g. check if new files are in the working directory) every n seconds in Python? The simplest method is executing time.sleep(n) within an infinite while loop. There are more elegant solutions: using coroutine frameworks, threaded task schedulers, etc. —

Re: do something every n seconds

2010-11-25 Thread Paul Rubin
Santiago Caracol santiago.cara...@gmail.com writes: how can I do something (e.g. check if new files are in the working directory) every n seconds in Python? Don't do it that way if you can help it. Use inotify or the equivalent instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: do something every n seconds

2010-11-25 Thread Stefan Sonnenberg-Carstens
Windows or UNIX ? Am Do, 25.11.2010, 13:38 schrieb Santiago Caracol: Hello, how can I do something (e.g. check if new files are in the working directory) every n seconds in Python? Santiago -- http://mail.python.org/mailman/listinfo/python-list -- MfG, Stefan Sonnenberg-Carstens IT

Re: do something every n seconds

2010-11-25 Thread Adam Tauno Williams
On Thu, 2010-11-25 at 04:38 -0800, Santiago Caracol wrote: how can I do something (e.g. check if new files are in the working directory) every n seconds in Python? Use the Python Advanced Scheduler in your application - it is a great little module. Then you've solved every 'scheduler' issue

Re: do something every n seconds

2010-11-25 Thread Steve Holden
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

Re: do something every n seconds

2010-11-25 Thread km
while True: time.sleep(10) print('hello python!') HTH, KM On Thu, Nov 25, 2010 at 8:35 PM, Steve Holden st...@holdenweb.com wrote: 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