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?
A:
time.sleep(10*60)
you might want to look into cron
or Scheduled Tasks services of the OS.
SilentGhost
2010-02-22 16:25:53
`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
2010-02-22 17:15:08
@Mike: and why do you think that this method should be precise?
SilentGhost
2010-02-22 17:17:51