from subprocess import Popen, PIPE
import sys
p = Popen('netsh',shell=False,stdout=PIPE, stderr=PIPE, stdin=PIPE)
while(True):
m = raw_input(">")
out = None
try:
p.stdin.write(m)
out = p.stdout.read()
except:
print sys.exc_info()
print p.returncode
print out
The problem is, the call to read() does not return. Anyone know a way to do this?


Sign In
Create Account


Back to top









