Closed arist0v closed 9 years ago
@arist0v Don't use os.system
. This is not particular to Pushy; if you were in a Python interpreter, os.system
would return the exit code (e.g. 0) and print the hostname to stdout.
If you want to run an arbitrary command and get its stdout as a result, then I suggest you use the subprocess
package. e.g.
con.modules.subprocess.Popen(["hostname"], stdout=con.modules.subprocess.PIPE).communicate()
(if you just want the hostname, then use the platform
package)
Closing, as there is no issue with Pushy. I have confirmed that the above works.
Hello, i use the following command: con.modules.os.system("hostname") the only return i get is 0. how could i get the return of command remotly executed?
thank you
Arist0v