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

Björn Lindström bkhl at
Wed Oct 5 15:48:44 CEST 2005

"alexLIGO" <dietz at> writes:

> I would like to execute some command in python on the bash, e.g.
> os.system('globus-job-run -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?

Check out the commands module.

Björn Lindström <bkhl at>
Student of computational linguistics, Uppsala University, Sweden

More information about the Python-list mailing list