Advertisement
Guest User

Untitled

a guest
May 14th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import subprocess
  3. import time
  4.  
  5. def getControl():
  6. p = subprocess.Popen(['python', 'wannaBeRich.py'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
  7. print "[*] Opening the process"
  8. p.stdin.write('n\n')
  9. print "[*] Writing 'n' into the process"
  10. line = p.stdout.readline()
  11. if line != '':
  12. print "[+] Process output: "
  13. print line.rstrip()
  14. i=0
  15. while i<100:
  16. print "[*] Writing 1 into the process"
  17. p.stdin.write('1\n')
  18. line = p.stdout.readline()
  19. print "[*] Reading process output"
  20. if line != '':
  21. print line.rstrip
  22.  
  23. i+=1
  24. getControl()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement