[Tutor] communication between java and python?

joeri honnef joerihonnef at gmail.com
Thu Jan 13 00:38:21 CET 2005


Dear Tutor,

I'm trying to communicate between Python and Java and using
os.popen(). But thing dont work...The Java program reads strings from
stdin and the python program just writes to stdout.

-first call the java program using:
                                    handlers = os.popen('java StdIn)

-then:
                                    handlers[0].write('string')
-and:
                                    return_value_from_java = handlers[1].read()

this does not work on WindowsXP using python 2.34 and the attached Java program.

thanks, JH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StdIn.java
Type: application/octet-stream
Size: 3396 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20050113/937052de/StdIn.obj


More information about the Tutor mailing list