Spotted Snakes

Rather than trying to follow up on my printer shenanigans or get the scanner to work, I’ve spent a while doing something a lot more interesting – pecking at the Python developer samples that ship with Leopard, which now include Quartz, wxWidgets and, of course, PyObjC samples galore.

Although it’s early days to say precisely how much use this will be to me, it is amazing to have full-blown Cocoa apps built entirely in Python included in the “official” examples, and I can see a lot of uses for things like appscript (which, although not included, can now be setup from source by completely standard means).

But if you want to check out all the Python goodness on a Mac system, just type pydoc -p 8000 in a Terminal window and visit http://localhost:8000 to browse through the local module index.

There is a lot in there, from Twisted to native Bonjour bindings, so there’s a lot of potential for creating Python networking tools with native interfaces.

And, of course, plenty of opportunity to mess around with graphical bits – there are more than a few Quartz samples, although they seem to be mostly ports of older, “classical” samples. But I haven’t really gone that far down that particular rabbit hole.

As it happens, most of my “toy” PyObjC stuff works just fine, including a graphical wrapper for these scripts (originally designed to manage an HSDPA modem, until I realized that most modern phones had Bluetooth PAN support) and an applet version of page archiver, so I just might clean them up a bit and post them for general consumption.

Incidentally, in /Developer/Examples/Python/PyObjC/WebKit/IEWebArchive (right next to demos of an embedded Python interpreter for your browser and a URL handler) you’ll find a first approach at converting IE .mht files into .webarchive files, which I’m seriously considering reversing so that I can turn .webarchive files into fully MIME-compliant messages for cross-platform archiving.

Any which way, it’s awfully nice to build a PyObjC sample (any sample) and get a neat little Python applet icon:

…all without installing anything besides what comes on the DVD.