LWN.net Logo

Pyjamas: writing AJAX applications in Python

Pyjamas: writing AJAX applications in Python

Posted Aug 27, 2009 15:15 UTC (Thu) by hppnq (guest, #14462)
Parent article: Pyjamas: writing AJAX applications in Python

That "Hello World" strikes me as very ugly, and a 23k line timesheet application makes me shiver. (A one page Gmail client?!) It looks to me that this is especially appealing to developers who simply want to develop in Python, and not in javascript and HTML. Fair enough.

But the main attraction of running code unadapted on the desktop and in a browser is the abstraction of the language. Technically these things are not extremely challenging; you can (already) develop, run and debug javascript on your desktop, with or without a browser. But being able to write things like

<window><button/></window>

and run it in a browser, or from the desktop, or in your head -- that is something completely different. Something like xul, what a relief.


(Log in to post comments)

Pyjamas: writing AJAX applications in Python

Posted Aug 28, 2009 10:33 UTC (Fri) by lkcl (guest, #60496) [Link]

yes i didn't know that this article was going to be written - i added some extra lines to the helloworld example and accidentally committed them, when testing some CSS styles on buttons and also testing the getModuleBaseURL function.

the original helloworld app was 8 lines long, and you can see it here:

http://pyjs.org/book/output/Bookreader.html#Getting%20Sta...

Pyjamas: writing AJAX applications in Python

Posted Aug 28, 2009 12:17 UTC (Fri) by lkcl (guest, #60496) [Link]

"Something like xul, what a relief."

yes - in fact, one of the ports of pyjamas to the desktop actually uses xulrunner. the xulrunner port is the most stable of the three: the MSHTML one has a couple of keyboard-event-related niggles, and the webkit one, one of the developers is being a bit of a twat. if you're interested in the pyxpcomext glue - in how pyjamas desktop joins up with xulrunner, or if you're interested in writing your own declarative pyxpcomext application, here's an article which explains it:

http://pyxpcomext.mozdev.org/no_wrap/tutorials/hulahop/xp...

this is a quite different - and i believe much simpler - approach than "standard" pyxcpomext apps, where you have to "register" your app with the mozilla xpcom infrastructure, then create a xulrunner shellscript wrapper (based on run-mozilla.sh) in order to start up the app - it's just such a pain (but has distinct advantages).

personally i much prefer to start from the python prompt, and the article above explains how to do exactly that.

Pyjamas: writing AJAX applications in Python

Posted Dec 8, 2011 7:16 UTC (Thu) by AvdN (guest, #81737) [Link]

I am not sure where the original 23K comes from. The example/timesheet directory has 1504 lines in .py files.
The resulting .js closer to 5K lines and the .html 42K for each of the supported browsers. But the latter two are IMHO non-important.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds