November 28th, 2012, 06:36 AM
Join Date: Nov 2012
Time spent in forums: 20 m 20 sec
Reputation Power: 0
Originally Posted by b49P23TIvg
subprocess.check_output("echo t | cat", shell=True,stderr=subprocess.STDOUT)
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.
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