Calling (C)Python code from Java: Is it JPype?

F. GEIGER f.geiger at vol.at
Thu Sep 30 01:57:39 EDT 2004


"Steve Menard" <foo at bar.com> schrieb im Newsbeitrag
news:1DI6d.223$j5.307837 at weber.videotron.net...

<snip/>

> So, what I would do is have Python be the "host", the controller,
> calling the JAVA-built GUI and registering listeners. JPype does not
> allow subclassing of Java classes in python, but you can crerate JProxy
> that "implement" any Java interface. The standard idiom for Java event
> and callbacks is based on the use of interfaces anyway. In fact, baring
> the very rare cases where Swing requires subclasses, you could crerate
> your whole GUI using Swing and not writing a single line of Java.

Just to be sure that I got you right: I'd write the GUI things in Java and
hook the Python stuff into the GUI by implementing listeners directly or by
implementing interfaces used by the listeners in Python (sorry, yet I'm not
very experienced in Java). For me this sounds like what I want to have: The
GUI in a compiled lang, the gist in Python. If so, I'll give it a try.

>
> Steve
>

Many thanks, Steve!

Cheers
Franz





More information about the Python-list mailing list