Background
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.
Current Code
def shutdown(self):
import subprocess
subprocess.call(["shutdown", "-f", "-s", "-t", "60"])
Question
What I am really asking is, is there a way (using the subprocess module) to logoff of and restart my computer?
Tech Specs
Python 2.7.3
Windows 7, 32 bit
See Question&Answers more detail:os