Guest User

Untitled

a guest
Feb 22nd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. import subprocess, time
  2.  
  3. command = "plink.exe -ssh -l admin -pw admin -C 192.168.1.1"
  4. p = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  5. p.stdin.write('yn')
  6. time.sleep(3)
  7. p.stdin.write('echo "hello world"')
  8. for line in iter(p.stdout.readline, b''):
  9. print line
  10. p.stdout.close()
  11. p.wait()
Add Comment
Please, Sign In to add comment