Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def restart():
- #Defines the restart subrouting
- command = "/usr/bin/sudo /sbin/shutdown -r now"
- #This is the reboot command. Source: my pi just rebooted.
- import subprocess
- #Imports the subprocess commands
- process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
- process becomes the result of executing 'command'. No idea what .split() and stdout do here.
- output = process.communicate()[0]
- #Run process?
- print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement