-1

I want to be able to use the time module to do some snippets of code, but I'm a bit confused. Granted this is the first time I use it so I don't know exactly how to. Here's my goal however:

import time
(every 10 minutes)
    # do something
faskiat
  • 689
  • 2
  • 6
  • 21
  • are you on *nix? If you are cron can be used to easily do this – dm03514 Jul 26 '13 at 13:42
  • Would this solve your problem: http://stackoverflow.com/questions/373335/suggestions-for-a-cron-like-scheduler-in-python – Justin Ethier Jul 26 '13 at 13:43
  • dm03514 I don't know what *nix is. Justin Ethier, that post both scares and confuses me. – faskiat Jul 26 '13 at 13:47
  • By *nix he means some variant of Linux or Unix. It's using the asterisk as a wildcard marker. – thegrinner Jul 26 '13 at 13:53
  • Oh my fault. Yes I'm using linux (ubuntu). I also have mac os at home and would want to implement it there too. I'm reading through the wiki on cron right now – faskiat Jul 26 '13 at 13:55

1 Answers1

4
import time

tenminutes = 600

while true:
  time.sleep(tenminutes)
  print "This is a reminder"

This would print something to the console every 10 minutes

Tall Paul
  • 2,398
  • 3
  • 28
  • 34