J
jas
I would like to redirect the output from os.system to a variable, but
am having trouble. I tried using os.popen(..).read() ...but that
doesn't give me exactly what i want.
...this is windows by the way.
For example:
tmp = os.popen("hostname").read()
....works as expected.
however,
tmp = os.popen("cmd").read()
....i would like to have access to the cmd process...i.e. enter commands
like a normal command line. os.system() allows this, but i dont want
output to the screen..i wanna store it to a variable. then send
content of variable elsewhere, receive more input and submit it.
almost emulate the windows command prompt.
any ideas?
am having trouble. I tried using os.popen(..).read() ...but that
doesn't give me exactly what i want.
...this is windows by the way.
For example:
tmp = os.popen("hostname").read()
....works as expected.
however,
tmp = os.popen("cmd").read()
....i would like to have access to the cmd process...i.e. enter commands
like a normal command line. os.system() allows this, but i dont want
output to the screen..i wanna store it to a variable. then send
content of variable elsewhere, receive more input and submit it.
almost emulate the windows command prompt.
any ideas?