How do I grab stdout from a shell command in jython?

Jim Boone jmboone at telocity.com
Wed Jan 23 20:35:25 EST 2002


Hi,

I recently began to explore using jython to handle many of the nasty text
processing tasks that I need to do in my Java programs.  Jython looked like
the answer to my prayers until I tried to apply it to a problem   I hope
someone can point me in the right direction.

I need to execute commands on AIX, parse the output, and package the results
as a Java Bean.  Since I am brand new to Python, I anxiously imported os and
tried to execute os.popen('command') and grab the output stream.  However,
popen has not yet been implemented in jython!  Given that big let down, does
anyone know how in the world can I execute a shell command and process the
resulting output stream from jython?  Thanks in advance for your help!

Jim







More information about the Python-list mailing list