title: How to make a python script which can logoff, shutdown, and restart a computer?
body: <p><strong>Background</strong></p>
  
  <p>I am currently in the process of teaching myself python, and I thought that it would be a very cool project to have a sort of "control center" in which I could shutdown, restart, and log off of my computer. I also want to use the subprocess module, as I have heard that the import OS module is outdated. </p>
  
  <p><strong>Current Code</strong> </p>
  
  <pre><code>def shutdown(self):
      import subprocess
      subprocess.call(["shutdown", "-f", "-s", "-t", "60"])
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>What I am really asking is, is there a way (using the subprocess module) to logoff of and restart my computer?</p>
  
  <p><strong>Tech Specs</strong></p>
  
  <p>Python 2.7.3</p>
  
  <p>Windows 7, 32 bit</p>