How to get the output from os.system() into a variable?

alexLIGO dietz at rouge.phys.lsu.edu
Wed Oct 5 09:43:35 EDT 2005


Hi,

I would like to execute some command in python on the bash, e.g.

os.system('globus-job-run mike4.cct.lsu.edu/jobmanager-pbs -l
/bin/date')

and want the result of the output in a vector, so something like:

result=python_command(' command_on_the_bash ')

Is that possible? And how to do that?

Thanks
Alexander Dietz




More information about the Python-list mailing list