pyjamas: GWT clone in Python

Since  has been  for a week, Google was  its new version yesterday. GWT is now so popular. Anyway, I don’t like to program in Java. Now, there is a serious effort to reverse engineer GWT to make a clone in Python for Python fans like me. In beginning, it named as py-gwt but now it has been changed to pyjamas and it’s alive. Let’s see how it looks like at the real code in subversion repository.

In Python:

from ui import Button, RootPanel

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

In JavaScript:

function Hello() {
}
Hello.prototype.onModuleLoad = function() {
    var b = new ui_Button("Click me");
    new ui_RootPanel().add(b);
}

function run() {
    h = new Hello();
    h.onModuleLoad();
}

function pygwtOnLoad(onLoadError, name) {
    if (onLoadError)
        try {
            run();
        } catch (exception) {
            onLoadError(name);
        }
    else {
            run();
    }
}

Cool!

Technorati Tags: , , , , , , ,

Pyjamas 0.3 Released

updated. pyjamas 0.3 supports IE7, now, as well as IE6, Opera, Safari, Mozilla and Firefox. http://pyjs.org also there's a port of pyjamas to the desktop, thanks to webkit: http://pyjd.org so, applications that conform to the Pyjamas API can be run - unmodified - in all major web browsers _and_ on the desktop. that's cool.

Post new comment