Thank you for your help but I'm searching a different way. Moreover it doesn't work always (for exaple: try a 'dir' command). Because of I'm implementing a remote shell the [[os.popen('command').read()]] rapresents the best for me because it can also accepts arguments direclty (for example: os.popen('netstat -a -n -o').read() and this is a great advantage. I was looking at sys.stdout and sys.stderr. Can they be helpful? Cheers > Use subprocess: > > from subprocess import Popen, PIPE > proc = Popen(['command', 'arg', 'arg'], stdout=PIPE, stderr=PIPE) > return_code = proc.wait() > if return_code == 0: > print "Success:\n%s" % proc.stdout.read() > else: > print "Failure %s:\n%s" % (return_code, proc.stderr.read())
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