Reputation: 2612
I have the following code in Python
import subprocess
import time
info = subprocess.STARTUPINFO()
info.dwFlags |= subprocess.STARTF_USESHOWWINDOW
info.wShowWindow = subprocess.SW_HIDE
t1 = time.clock()
h = subprocess.Popen([r"C:\Users\MyName\Desktop\test.exe"], startupinfo=info)
h.communicate()
t2 = time.clock()-t1
print "Return Code:", h.returncode
print "Duration:", t2
This works great if I am looking for the program's return code but what if I want to grab things that the program simply cout's to the screen and manipulate them as variables in Python?
Upvotes: 0
Views: 102