Advertisement
Guest User

Untitled

a guest
Mar 13th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. def restart():
  2. #Defines the restart subrouting
  3.     command = "/usr/bin/sudo /sbin/shutdown -r now"
  4.     #This is the reboot command.  Source: my pi just rebooted.
  5.     import subprocess
  6.     #Imports the subprocess commands
  7.     process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
  8.     process becomes the result of executing 'command'.  No idea what .split() and stdout do here.
  9.     output = process.communicate()[0]
  10.     #Run process?
  11.     print output
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement