How do I capture the output of os.system()

Frank Teoh frankteoh at gmail.com
Fri Oct 22 06:46:00 EDT 2004


I am trying to capture the output of os.system() into a string without
success. Since os.system() returns only its exit_status, how can I do
that?
system(...)
        system(command) -> exit_status
        
        Execute the command (a string) in a subshell.

My aim is to capture the return value of os.system("rsh
<netapp_filer_host> qtree")

Thanks.
-FT



More information about the Python-list mailing list