Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Use python and Jython together? (newbie)

191 views
Skip to first unread message

Christian Heimes

unread,
Mar 13, 2010, 10:10:22 AM3/13/10
to Karjer Jdfjdf, pytho...@python.org
Karjer Jdfjdf wrote:
> I'm pretty new at programming and want some advice on mixing Jython and Python.
>
> I want to use Jython to access some Java libraries, but I want to keep developing in normal Python. Some modules I use a lot are not available in Jython.
>
> The bulk of my programming is in Python but I want to use Java 2D libraries for graphical presentation of data generated in normal Python. Is it possible that I generate data in Python and then pass it through to a Jython program to visualise the data.

You can't mix Jython and Python in one program. But you can use other
means to create bindings for Java code. JCC
(http://pypi.python.org/pypi/JCC/2.5.1) is a very powerful code
generator for CPython.

Christian

MRAB

unread,
Mar 13, 2010, 1:13:46 PM3/13/10
to pytho...@python.org
Karjer Jdfjdf wrote:
> I'm pretty new at programming and want some advice on mixing Jython and
> Python.
>
> I want to use Jython to access some Java libraries, but I want to keep
> developing in normal Python. Some modules I use a lot are not available
> in Jython.
>
> The bulk of my programming is in Python but I want to use Java 2D
> libraries for graphical presentation of data generated in normal Python.
> Is it possible that I generate data in Python and then pass it through
> to a Jython program to visualise the data.
>
You could have 2 scripts running, one in CPython and the other in
Jython, communicating via sockets. You would need to decide on a
protocol, perhaps passing the data as strings encoded in UTF-8.

Waldemar Osuch

unread,
Mar 13, 2010, 6:12:11 PM3/13/10
to
I have not tried it myself but it seems to be possible.
http://jpype.sourceforge.net/

0 new messages