title: Python script to restart a Raspberry Pi
body: <p>I think what I want is straight forward.</p>
  
  <p>Python script to restart my Raspberry Pi after 23 hours and 59 minutes. The reason I am trying to do this, instead of set times with a cron job, is the Pi has no onboard battery for a clock so I don't care what the time is (if connected to internet, it will source current time), just a count down of 23 hours and 59 minutes from the script starting.</p>
  
  <p>This is as far as I have got;</p>
  
  <pre><code>def restart():
  SendEmail = SendEmail "SYSTEM RESTART", "ncam.py auto restart initiated"      msg['Subject'], body)
  command = "/usr/bin/sudo /sbin/shutdown -r now"
  process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
  output = process.communicate()[0]
  </code></pre>
  
  <p>Also I want to send an email to myself with the set parameters as above.</p>