How would you go about a having a function check something every ten minutes? I would like to check a directory for new files every ten minutes. I know python has a time library but can it be used for this?
Asked
Active
Viewed 404 times
0
-
2Duplicate: http://stackoverflow.com/questions/373335/suggestions-for-a-cron-like-scheduler-in-python. Also, http://stackoverflow.com/questions/1038907/run-a-task-at-specific-intervals-in-python – S.Lott Feb 22 '10 at 16:38
3 Answers
1
0
time.sleep(10*60)
you might want to look into cron
or Scheduled Tasks services of the OS.

SilentGhost
- 307,395
- 66
- 306
- 293
-
1`sleep` is an awful way to do this; it is inaccurate and inflexible. Depending on the task, an OS scheduler like `cron` would be a great way to go. – Mike Graham Feb 22 '10 at 17:15
-