Guest User

Untitled

a guest
Jul 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. cat SomePythonScript.py | ssh remote_machine 'cat - | python'
  2.  
  3. from subprocess import PIPE , Popen
  4.  
  5. p1 = Popen(["cat ", "SomePythonScript.py"], stdout=PIPE)
  6. p2 = Popen(["remote_machine"], stdin=p1.stdout, stdout=PIPE)
  7. p3 = Popen(["cat -", "python"], stdin=p2.stdout, stdout=PIPE)
  8.  
  9. p1.stdout.close()
  10. p2.stdout.close()
  11.  
  12. output = p3.communicate()[0]
  13.  
  14. from subprocess import PIPE , Popen
  15. p1 = Popen([["cat", "SomePythonScript.py"], stdout=PIPE)
  16. p2 = Popen(["remote_machine","cat", "- python"], stdin=p1.stdout, stdout=PIPE)
  17. p1.stdout.close()
  18. output = p2.communicate()[0]
  19.  
  20. from subprocess import PIPE , Popen
  21.  
  22. p1 = Popen(["cat", "SomePythonScript.py"], stdout=PIPE)
  23. p2 = Popen(["ssh", "remote_machine", "cat - | python"], stdin=p1.stdout, stdout=PIPE)
  24.  
  25. p1.stdout.close()
  26.  
  27. output = p2.communicate()[0]
Add Comment
Please, Sign In to add comment