Posts tagged: PYTHON

WebKit screen-grabbers

Missing in action for many months after a server hard drive failure, the webkit2png utility by Paul Hammond reappeared in August. It uses WebKit to automatically render PNG images of web pages. It beats regular screen grabs mainly in its ability to render full-length images – as if you had an infinitely tall monitor. By default it produces three versions: an actual-size “clipped” version, an actual-size long version, and a thumbnail-size long version (here’s an example). It requires that you have PyObjC.

Controller freaks

The recent posting by Ben Bangert entitled “Best of breed Controllers for MVC web frameworks” is interesting reading. (Also see his followup with corrections.) Rather than trying to stage a showdown, he’s noting significant similarities between the controller styles in CherryPy, Myghty, Bricks, Aquarium, Ruby on Rails, and Django. The implication I take is that this (mostly independent) convergence might be telling us something about smart web application development.

The post is worth reading for the comment thread alone, with posts from core Zope, CherryPy, Django, and TurboGears developers (among others) and a great little discussion of the history of object publishing on the web.

YAPWF: TurboGears

Even if all the recent interest in Django hasn’t stopped other people from trying to create Python web frameworks, I think it has raised the bar for what people decide to unleash on the world.

Enter TurboGears.

Though it’s billed as a “megaframework,” its structure is almost identical to plain ol’ frameworks Subway and Fanery: a stack combining SQLObject, CherryPy, and a templating system (in this case, Kid). TurboGears also adds Ajax support via MochiKit.

It’s installable via setuptools; even if this means you need to install setuptools first, the net effort required is still less than manually installing TurboGears and its four separate framework components. Dependency management is no small thing when you’re combining several pieces that are all evolving rapidly.

Python and XUL

I can hardly pose as knowledgeable about XUL, having only just recently learned to pronounce it, but I’m happy to learn that the Mozilla project is moving forward with XUL bindings for Python. I prefer the more revolutionary slogan, though: “Breaking the grip JS has on the DOM”. Yes! Cast off the chains!

If you’re not versed in the internals of Mozilla, a good bit of that wiki page will make your eyes glaze over. If you’ve remained conscious, also check out Brendan Eich’s blog posting on the subject and the comments on bug #255942.

PyObjC in, Cocoa-Java out

The Apple Developer Connection recently posted what looks like a nice introduction to PyObjC. It’s even got QuickTime movies showing how to work with Interface Builder. Cool. The enthusiasm on the page is palpable:

PyObjC’s maturity is unmatched - it’s been around longer than even Apple’s Java bridge (it originated on NeXTstep).

Meanwhile, in case you missed it, the Cocoa-Java bindings are deprecated:

Features added to Cocoa in Mac OS X versions later than 10.4 will not be added to the Cocoa-Java programming interface. Therefore, you should develop Cocoa applications using Objective-C to take advantage of existing and upcoming Cocoa features.

State of the Python Union

Belatedly, here are my notes from Guido van Rossum’s “State of the Python Union” talk this past Wednesday.

Guido discusses (with illustrations) his recent eye problems.

SD Magazine/Jolt Productiviity Award given to Python 2.4. O’Reilly Python book sales are up. Unscientifically extracted Sourceforge stats: about 4000 python projects.

Discussion of PEP 342 and PEP 343 broke records on python-dev (“What about decorators?” somebody asks. “I think this was worse,” Guido says.)

PEP 342: Generator enhancements. Can we make yield do some of the things that it does in Ruby? Yield becomes an expression instead of a statement.

CodeZoo

O’Reilly has been running CodeZoo for a few months now. Today they announced CodeZoo subsites for Python and Ruby. CodeZoo is very slick – you can track changes to a particular app or component via a special RSS feed, for instance. Downloads are fast and simple, even for Sourceforge-hosted projects. And they’ve got this new thing called DOAP (why do you think they call it DOAP?), an XML schema for component information. (Tangent: I’m thinking that DOAP could be a nice standard upon which to build phone-home version checking features.)