i have application have load via popen in python.during runtime,application prompt confirmation message stating "can continue?".over here,we have provide yes/no option.
the popen executes command application doesn't prompt "can continue" message.it stops @ point.if run application manually,application prompts confirmation message.
proc=subprocess.popen(['app.exe -start'],shell=true, stdin=subprocess.pipe, stdout=subprocess.pipe) let me know in case missing parameters.
if pass stdout=subprocess.pipe option, output redirected pipe , not displayed. can compare 2 functions :
p1 = subprocess.popen(["ls"]) p2 = subprocess.popen(["ls"], stdin=subprocess.pipe, stdout=subprocess.pipe) the first 1 prints output of command, second not. can access p2.stdout.read().
so if want see output of script (and manually type confirmation), use
proc = subprocess.popen(['app.exe -start'], shell=true) else, have interact proc.stdin , proc.stdout
ps : use of shell=true discouraged, remove if can. important if command want run contains user input.
Comments
Post a Comment