title: Reboot system through cronjob
body: <p>I'm running a python script as the root user. (I know its not reccomended but in my case its ok.)
  At the end of this script, based on some conditions I need to reboot the raspberry. </p>
  
  <p>I have tried several codes but none actually reboots the machine. I have tried this at the end of my .py file:</p>
  
  <pre><code>os.system("shutdown -r now")
  reboot
  sudo reboot
  os.system("reboot")
  </code></pre>
  
  <p>None of these reboots the raspberry. What is the proper code to reboot the system?</p>