Here's an interesting article pertaining to Runtime/Process:
 
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
 
brian
-----Original Message-----
From: jython-users-admin@lists.sourceforge.net [mailto:jython-users-admin@lists.sourceforge.net]On Behalf Of Brian Zimmer
Sent: Monday, March 19, 2001 4:42 PM
To: John E. Conlon; jython-users@lists.sourceforge.net
Subject: RE: [Jython-users] How to call external commands

Here's an extremely simple example (by no means production, but could get you on your way):

"""
 Process the command.
"""

from java.lang import Runtime
from java.io import BufferedInputStream

p = Runtime.getRuntime().exec("ls")
#p.waitFor()
stream = BufferedInputStream(p.getInputStream())

e = []

r = stream.read()
while r != -1:
 e.append(r)
 r = stream.read()

print "".join(map(chr, e))

Running it produces:

D:\home\development\python>jython process.py
HTTPSession$py.class
HTTPSession.py
__init__.py
a5.py
aar.py
acl.py
aioobe.py
ant.py
atl.py
caps.py
cont.py

brian


-----Original Message-----
From: jython-users-admin@lists.sourceforge.net
[mailto:jython-users-admin@lists.sourceforge.net]On Behalf Of John E.
Conlon
Sent: Monday, March 19, 2001 4:22 PM
To: jython-users@lists.sourceforge.net
Subject: [Jython-users] How to call external commands


Hi Jython users,

I would like to replace my bat and sh startup scripts with jython py
scripts.  But after experimentation I can not figure out how to call
external executables in my underlying system. 

Have seen comments that the os.system(name) command is not yet implemented.
 Is there any other way to launch external programs without the os.system
command?

thanks for any suggestions,

John

_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/jython-users