Hi all, I am trying to capture the output written to the stdout during an os.system() call. ( BTW i am trying to invoke the system tftp through os.system().) I was trying out the following way. (rd, wr) = os.pipe() print rd, wr dup_stdout = os.dup(1) os.dup2(wr, 1) ret = os.system(line) ### line contains the tftp command res = os.read(rd, 64) os.dup2(1, dup_stdout) os.fdopen(1, 'a+') print res But i couldn't get the 'stdout' to revert back to the fd of '1'. If any one has any ideas on this or any more elegant methods of doing this, please help me out. Thanks in advance, Praveen.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4