Vote count:
0
i am trying to run a command racadam from dell(its a command line tool), into a subprocess.popen.
but I cant get back the stdout, or the stderr. this is what I am doing.
pp = subprocess.Popen(prog, shell=True,tdout=subprocess.PIPE,stderr=subprocess.PIPE)
pp.communicate()
print pp.communicate()
print pp.communicate()[0]
print pp.communicate()[1]
print pp.stdout.readlines()
print pp.stderr.readlines()
out, err = pp.communicate()
print out
print err
and I just get
('', '')
[]
[]
when it should be printing the help with what arguments do what.
the funny thing is I can see that program terminal opening, printing some lines and then close super super fast. so I know that the program is running I just cant get the information back to python =( may I bee missing some steps? or is there a hidden trick?
thanks guys.
asked 1 min ago
python popen doesnt print stdout
Aucun commentaire:
Enregistrer un commentaire