Integrating Python into GWT

275 views
Skip to first unread message

simplename

unread,
Feb 4, 2008, 1:28:07 AM2/4/08
to Google Web Toolkit
hey everyone.

I have developed a GUI which displays and allows user inputs of a
graph/network using GWT and now looking into using NetworkX (https://
networkx.lanl.gov/wiki) library for my project. The reason is NetworkX
provides some nice graphic visualisation and also some built in
calculation functions for graphs. However, the examples provided are
all in python only, is there anywat that Python can be integrated into
GWT???


thank you very much.

Andrij Skalyuk

unread,
Feb 4, 2008, 3:58:45 AM2/4/08
to Google Web Toolkit
See on GWT like a JavaScript library in results.
So you can use python library on server side in your project.
GWT can get results from python code on server through JSON (example
here: http://code.google.com/webtoolkit/examples/jsonrpc/)
Or in your case GWT can get visualization results (pictures) in HTTP
AJAX response.

simplename

unread,
Feb 4, 2008, 11:14:33 PM2/4/08
to Google Web Toolkit
Hi Andrij thank you for help.
The problem is my project had been developed using Java.
NetworkX however requires using code written in Python to call any
methods from its library.
How can these two integrate with each other?
Sorry if this is something that is painfully obvious and easy I'm not
familair with Python and integrating one coding language in another
(if there is a way to do so).

On Feb 4, 6:58 pm, Andrij Skalyuk <sca...@ukr.net> wrote:
> See on GWT like a JavaScript library in results.
> So you can usepythonlibrary on server side in your project.
> GWT can get results frompythoncode on server through JSON (example
> here:http://code.google.com/webtoolkit/examples/jsonrpc/)
> Or in your case GWT can get visualization results (pictures) in HTTP
> AJAX response.
>
> On Feb 4, 8:28 am,simplename<nanasuiwestw...@gmail.com> wrote:
>
> > hey everyone.
>
> > I have developed a GUI which displays and allows user inputs of a
> > graph/network using GWT and now looking into using NetworkX (https://
> > networkx.lanl.gov/wiki) library for my project. The reason is NetworkX
> > provides some nice graphic visualisation and also some built in
> > calculation functions for graphs. However, the examples provided are
> > all inpythononly, is there anywat thatPythoncan be integrated into

Andrij Skalyuk

unread,
Feb 5, 2008, 7:00:05 AM2/5/08
to Google Web Toolkit


On 5 фев, 06:14, simplename <nanasuiwestw...@gmail.com> wrote:
> Hi Andrij thank you for help.
> The problem is my project had been developed using Java.
> NetworkX however requires using code written in Python to call any
> methods from its library.

Must be you have many Java code on the server side on your projects
and you want to use GWT in client side.
right ?
GWT is compiler from Java to JavaScript (because browser can execute
javaScript, not Java).

> How can these two integrate with each other?
> Sorry if this is something that is painfully obvious and easy I'm not
> familair with Python and integrating one coding language in another
> (if there is a way to do so).
>

Yes. You can integrate Python library in Java code on server side.
This way called "language bindings".
Check out this project http://www.jython.org/

But as i see you want generate some charts or graphs in Python
library. If this is single option that you want to use there, you can
integrate very simply - with HTTP interface. Your Java code calls
python library like any http-deamon and use results that it returns.
Reply all
Reply to author
Forward
0 new messages