GWT Hello World in Python

Eventually, pyjamas has reached the first milestone to write Hello World example in Python and then translate them to JavaScript and HTML. Note that it also supports event handling. Let’s see how it looks like in action.

from ui import Button, RootPanel
import Window

def greet(sender):
    Window.alert("Hello, AJAX!")

class Hello:
    def onModuleLoad(self):
        b = Button("Click me", greet)
        RootPanel().add(b)

Great! In order to produce JavaScript and HTML, you have to get the whole source tree at http://pyworks.org/svn/py-gwt/trunk/ and run build.py in helloworld directory as follow.

python ../../builder/build.py Hello

Thanks James Tauber for this nice job.

Technorati Tags: , , , , , , , , , , ,

Post new comment