Gabe
Gabe

Reputation: 549

Scheduling Python Programs

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?

Upvotes: 0

Views: 419

Answers (3)

ghostdog74
ghostdog74

Reputation: 342433

for checking of files, you may want to try pyinotify

Upvotes: 0

Martin
Martin

Reputation: 7149

The sched module is worth a look.

Upvotes: 1

SilentGhost
SilentGhost

Reputation: 319621

time.sleep:

time.sleep(10*60)

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

Upvotes: 0

Related Questions