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"
interfaces.    

from java.lang import Runtime
from java.io import BufferedReader
from java.io 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'
    else:    
        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 ''
    else:    
        print s  

Regards,
Claude

Claude Falbriard
Developer
AMS Hortolāndia / SP - Brazil
phone: +55 13 8117 3316
e-mail:  claudef@br.ibm.com



<lyndon.vanwagner@thomson.com>
Sent by: jython-users-bounces@lists.sourceforge.net

04/25/2007 02:37 PM

To
<jython-users@lists.sourceforge.net>
cc
Subject
[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.
 
Thanks.
 
--Lyndon-------------------------------------------------------------------------
This SF.net 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.
http://sourceforge.net/powerbar/db2/_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users