
November 28th, 2012, 06:36 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 2
Time spent in forums: 20 m 20 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by b49P23TIvg use shell=True
unix example:
subprocess.check_output("echo t | cat", shell=True,stderr=subprocess.STDOUT) |
Hi b49P23TIvg,
Thanks for your input. but that doesnt work for me.
I resolved the issue by using two subprocesses, and providing the output of the first process as input to second process.
Code:
p = subprocess.Popen("echo t |", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
p1 = subprocess.Popen(["svn.exe", "list", "Https://127.0.0.1:443/svn/Repos"], shell=True, stdin=p.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
output = p1[0]
|