title: Python~Weekly time of day/week monitor
body: <p>The basic concept of what i'm trying to do:</p>
  
  <p>I want it to Check if it's 2-5pm and Sunday {every-{2 hours}
  if True it should continue to the bottom of the script(which emails me my servers status) and in 36 hour's to reset the timer/it's active search to see if its Sunday at 2-5 pm</p>
  
  <p>I've seen a few different methods for timers but i couldn't find one that actively scan's to see if it's the specified time(in this case it'd be ideal if it checked if it was 2-5pm on a Sunday every 2 hour's)</p>
  
  <p>Any Help would be greatly Appreciated
  Respectfully,
  Jame's </p>
  
  <p>Edit:
   Got it outputting information right after i reposted, just had to add the time module lol :P</p>
  
  <p>Script so far i havent implemented the .py launching portion yet but ill update the post when i get that going forsure.</p>
  
  <pre><code>import datetime
  import croniter
  import crontab
  import time
  
  c = croniter.croniter("0 20,21,22 * * SUN")
  next_due_date = c.get_next(datetime.datetime)
  
  print c.get_next(datetime.datetime)
  
  while True:
      now = datetime.datetime.now()
      if now &gt; next_due_date:
          do_something()
          time.sleep(60 * 60 * 36)
      else:
          time.sleep(60 * 60 * 2)
  </code></pre>
  
  <p>Edit2: My attempt at adding the file path: results in a keyerror</p>
  
  <pre><code>import datetime
  import croniter
  import crontab
  import time
  
  c = croniter.croniter("0 20,21,22 * * SUN ./line.py")
  next_due_date = c.get_next(datetime.datetime)
  
  print c.get_next(datetime.datetime)
  
  while True:
      now = datetime.datetime.now()
      if now &gt; next_due_date:
          do_something()
          time.sleep(60 * 60 * 36)
      else:
          time.sleep(60 * 60 * 2)
  </code></pre>