0

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?

S.Lott
  • 384,516
  • 81
  • 508
  • 779
Gabe
  • 539
  • 7
  • 19
  • 2
    Duplicate: 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 Answers3

1

The sched module is worth a look.

Martin
  • 7,089
  • 3
  • 28
  • 43
0

time.sleep:

time.sleep(10*60)

you might want to look into cron or Scheduled Tasks services of the OS.

SilentGhost
  • 307,395
  • 66
  • 306
  • 293
0

for checking of files, you may want to try pyinotify

ghostdog74
  • 327,991
  • 56
  • 259
  • 343