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: Development, Announcement, English, Programming, Python, , Py-gwt, Pyjamas
- sugree's blog
- 8076 reads
Pyjamas 0.3 Released
Post new comment