alexLIGO wrote: >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? > > You can use one of these:
the subprocess module: http://docs.python.org/lib/module-subprocess.html the popen2 module: http://docs.python.org/lib/module-popen2.html popen and spawn variants from the os module: http://docs.python.org/lib/os-process.html pexpect (it is not in the standard library): http://pexpect.sourceforge.net/ I believe that if you do not need the extended functionality of "pexpect", then you should start with the "subprocess" module. It is the newest. Les -- http://mail.python.org/mailman/listinfo/python-list