title: How to shutdown windows 8 with python 2.7 using a timer
body: <p>I'm doing a small project to learn more about python 2.7. Im making a shutdown timer, I got the GUI all set up and I just need the command to shutdown windows 8. The cmd command is: shutdown /t xxx. </p>
  
  <p>I have tried the following:</p>
  
  <pre><code>import subprocess
  time = 10
  subprocess.call(["shutdown.exe", "/t", "time"])
  
  
  import os
  time = 10
  os.system("shutdown /t %s " %str(time))
  </code></pre>
  
  <p>Both don't work.
  Any help appreciated, I'm using Windows 8 so I think solutions with windows 7 are different.</p>
  
  <p>Thanks for the answers, here is the shutdown timer i made:</p>
  
  <p><a href="https://github.com/hamiltino/shutdownTimer" rel="nofollow">https://github.com/hamiltino/shutdownTimer</a></p>