Dear Lyndon,

 enclosed you find a "javaneese" approach for get access to the Unix man
commands. The sample below use the Java native OS runtime access. It
works for SOLARIS OS commands as well as for WINDOWS "prompt"

from java.lang import Runtime
from import BufferedReader
from import InputStreamReader

p = Runtime.getRuntime().exec("man -k man")    
stdInput = BufferedReader(InputStreamReader(p.getInputStream()))
stdError = BufferedReader(InputStreamReader(p.getErrorStream()))

print "Here is the standard output of the command:\n"
s = ' '
while (s != None):
    s = stdInput.readLine()
    if (s is None):
        print 'end-of-console-printout\n'
        print s  

print "Here is the standard error of the command (if any):\n"
s = ' '
while (s != None):
    s = stdError.readLine()
    if (s is None):
        print ''
        print s  


Claude Falbriard
AMS Hortolāndia / SP - Brazil
phone: +55 13 8117 3316

Sent by:

04/25/2007 02:37 PM

[Jython-users] what to use in place of pydoc ?

Jython users:
Hi. I'm fairly new to jython & python; but moving long in the learning curve.
I've been porting some python & mxODBC code to jython and zxJDBC; and ran into something.
One of the program's options is to display a "man-page" using pydoc; which of course isn't in jython .
How do I go about duplicating this effect in jython ?
BTW, I'm running jython-2.2b1, java 6.0u1 on Solaris 10 x86.
This email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Jython-users mailing list