Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import subprocess
- import time
- def getControl():
- p = subprocess.Popen(['python', 'wannaBeRich.py'], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
- print "[*] Opening the process"
- p.stdin.write('n\n')
- print "[*] Writing 'n' into the process"
- line = p.stdout.readline()
- if line != '':
- print "[+] Process output: "
- print line.rstrip()
- i=0
- while i<100:
- print "[*] Writing 1 into the process"
- p.stdin.write('1\n')
- line = p.stdout.readline()
- print "[*] Reading process output"
- if line != '':
- print line.rstrip
- i+=1
- getControl()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement