Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess, time
- command = "plink.exe -ssh -l admin -pw admin -C 192.168.1.1"
- p = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
- p.stdin.write('yn')
- time.sleep(3)
- p.stdin.write('echo "hello world"')
- for line in iter(p.stdout.readline, b''):
- print line
- p.stdout.close()
- p.wait()
Add Comment
Please, Sign In to add comment