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
  • 373,146
  • 78
  • 498
  • 766
Gabe
  • 519
  • 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
  • 6,869
  • 3
  • 27
  • 43
0

time.sleep:

time.sleep(10*60)

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

SilentGhost
  • 287,765
  • 61
  • 300
  • 288
0

for checking of files, you may want to try pyinotify

ghostdog74
  • 307,646
  • 55
  • 250
  • 337