Hi all. I'm trying to execute system commands and capture the output by
using popen4:
stdout example:[color=blue][color=green][color=darkred]
>>>exec_cmd = popen2.popen4(" echo hello!")
>>>output = exec_cmd[0].read()[/color][/color][/color]
hello
stderr example:[color=blue][color=green][color=darkred]
>>>exec_cmd = popen2.popen4(" echobv hello!")
>>>output = exec_cmd[0].read()[/color][/color][/color]
Unrecognized command
The problem occurs when I try to execute interactive commands like ftp,
python intepreter etc...
In this case the program crashes without even giving an error.
Suggestions?
Regards
using popen4:
stdout example:[color=blue][color=green][color=darkred]
>>>exec_cmd = popen2.popen4(" echo hello!")
>>>output = exec_cmd[0].read()[/color][/color][/color]
hello
stderr example:[color=blue][color=green][color=darkred]
>>>exec_cmd = popen2.popen4(" echobv hello!")
>>>output = exec_cmd[0].read()[/color][/color][/color]
Unrecognized command
The problem occurs when I try to execute interactive commands like ftp,
python intepreter etc...
In this case the program crashes without even giving an error.
Suggestions?
Regards
Comment