PyOhio

I just found out that my hometown of Columbus, Ohio, is holding a Python conference.

This is really cool. I encourage anyone in the area who is interested in computer programming or knows anyone who is to spread the word about this. Aside from being a really fun and easy language to learn and use—it’s simple enough to be taught to children—it’s also powerful enough to be widely used in the industry (for instance, it’s the flagship language of the recently-released Google App Engine).

For those who are unfamiliar with the language, xkcd describes it pretty well, too.

Python as a Platform

Something that recently occurred to me is that the only operating system that doesn’t come with Python pre-installed on it is Windows.

While Linux and OS X both view Python as essentially a first-class development platform–i.e., as something that shrink-wrap applications can be built on–Windows does not. Instead, it’s generally expected that a Python-based Windows application be “frozen”: bundled into a self-contained package that includes a copy of the Python interpreter and whatever libraries it uses, which are private to the particular application. While this ensures that the application will function as expected and not run into “dependency hell”, it also results in a relatively large download–distributing a simple “Hello World” program is at least a megabyte in size, and makes extending the program’s functionality more difficult.

During the summer of 2007, I made simple Python-based tool for some friends who played World of Warcraft; for those that played on the Mac, the situation was easy because their computers already had Python on them. For the Windows users, however, I was faced with the dilemma of either “freezing” the program into a fairly large download which would be difficult to test and update, or making my friends download the Python installer from python.org and running my Python script from source. Either solution seemed too cumbersome.

So instead, I opted for a different solution: I’d create a tiny executable that would first check for the existence of a Python installation on the end-user’s system. If Python was already installed, the executable would simply extract a Python script from itself and run it. That script was much like ez_setup.py; along with a few tricks, it essentially ensured that my friends would transparently auto-update to the latest version of the tool whenever they launched the program.

If there was no Python installation on the end-user’s system, however, the executable would simply transparently download the latest Python installer from python.org, silently install it on the end-user’s system without any prompting, and then proceed as outlined above.

So, in other words, a small executable file–only about 50k in size–was essentially responsible for “bootstrapping” my program by downloading and silently installing Python if necessary, and then downloading and running the latest version of my program’s source code. This ultimately meant that the user would be able to run a self-updating Python program from a tiny executable without having to click through any installation prompts or dialog boxes.

I’m glossing over a few details here and there are definitely some holes in my implementation–for instance, if the user uses a web proxy, they’re hosed–but I thought the general idea was interesting.

The source for the executable was compiled using the Nullsoft Scriptable Install System, along with its InetLoad plug-in. The source file is below for those interested.

Continue reading “Python as a Platform”

A Simple Mozilla Build Script and Tutorial

Last Wednesday, I started working at Mozilla, the awesome company responsible for leading and coordinating the development of the Firefox browser. I’m now working for their labs team, exploring new ways of making the internet easier to use. Everyone I’ve met here so far is very friendly, intelligent, and motivated to make the web a better place; I’m really looking forward to working with them more.

One of the first tasks I’ve given myself here has been to get myself acquainted with the Mozilla build system, which is used to build Firefox, among other Mozilla projects. I’m most familiar with SCons, a Python-based tool we use at Humanized to develop Enso, and while I have some experience with Makefiles and the GNU Autotools, it’s been enlightening to see how the build system for a project as large as Firefox works.

While doing this, I spoke with Mike Meltzner, who passed me some gems of wisdom that were given to him by Vlad Vukicevic regarding a different way of setting up the build system than the one prescribed in the Mozilla Build Documentation.

I thought that the way Mike and Vlad did things was much more preferable than the one prescribed in the traditional build documentation, largely because it kept the CVS checkout 100% “pristine” and used a completely separate, parallel directory structure for everything else; aside from providing a really clean separation between what was under version control and what wasn’t, this gave me a much better idea of how the build system actually worked. Mike said that his way of doing things wasn’t documented anywhere, so I figured I’d write a simple script/tutorial that walks a reader through the setting up of the build system, the checking-out of Firefox from the source code repository, and the building of the application itself. It works on my OS X machine; I’m not sure if it works under cygwin or Linux, but I imagine it should.

Feedback is appreciated.

Continue reading “A Simple Mozilla Build Script and Tutorial”

Pickle Presentation Slides

At yesterday’s Chicago Python User Group (ChiPy) meeting, I gave a presentation on the Python pickle module; I’d always been curious in the internals of how serialization works “under the hood” and wanted to learn enough about it to give a talk that was accessible to Python newcomers and veterans alike.

I’d like to thank Robert Zeh of GETCO for hosting the meeting, and everyone for attending–we had a great turnout. Jono DiCarlo gave an awesome presentation on a video game he made with his 7-year old sister, Christopher Allan Webber showcased a really cool animation framework he created called PyStage, and Steve Githens gave a lightning talk on OpenOffice.org’s latest support for Python scripting.

I’ve posted the slides for my talk in PDF format for anyone interested.

Humanized

In late 2005, three colleagues and I founded a company called Humanized. A little over a month ago, we released our first two products, Enso Launcher and Enso Words.

I’m indebted to my incredible co-workers, Jono DiCarlo, Aza Raskin, and Andrew Wilson, for making this possible. Working at Humanized has certainly been the best job I’ve ever had, not to mention an excellent learning experience. Naz Hamid was also instrumental in providing us with superb graphic design and was very helpful as a business mentor in general. Special thanks also go to Andrew Huff, Sten Larsson, Erik Christensen, and Megan Bernard.

If you’d like to learn more about our product line, you may want to take a look at the Enso tour movie.

Slightly Old Stuff

The following is a summary of stuff I worked on before the new Toolness was created, but after I stopped maintaining any of my old sites.

Programming

Narrowcaster – During the summer of 2004, I realized how great RSS syndication was and decided to get an aggregator. Unfortunately, all of them were horribly complicated: highly modal interfaces, tons of tabs and controls and buttons to mess around with and what have you. Taking some inspiration from the design of Google News, I whipped up my own aggregator using Python and MySQL. The interface is relatively humane, and the aggregator features some built-in filtering of certain feeds: for instance, stories from Slashdot that I’m not interested in–e.g., anything under their “Linux” category–are automatically filtered out. Since this was created solely for personal use, it’s still rather buggy in some rarely-used places; nonetheless, one year later, I (and at least one other person I know) still use this aggregator multiple times per day. The name “narrowcaster” refers to the concept of narrowcasting, which I first encountered in Nicholas Negroponte’s book Being Digital.

SWKOTOR2 Secret Tomb Bugfix – In June 2005, I played through Star Wars – Knights of the Old Republic II: The Sith Lords, which ended up being a terrific game. However, there were also a number of major scripting-related bugs in the game, a few of which tripped me up while I was playing it. After finding out about some of the restoration projects going on to fix the game’s bugs and restore some of its cut content, I decided to contribute.

Writing

A Farewell to Jef Raskin – This is something I wrote in remembrance of the death of Jef Raskin, commonly credited as the inventor of the Macintosh computer, in February 2005. Jef was a professor of mine in graduate school and later became my employer.

Plundered Hearts review – During the spring of 2004, I played through a slew of old Infocom interactive fiction titles and wrote reviews for three of them. The other two were for Planetfall and Wishbringer.

Food Force reviewFood Force was a ridiculous little edutainment game that the UN World Food Programme released in the spring of 2005. Having a particular interest in the oft-neglected genres of video gaming–especially edutainment–I decided to review this title.

Façade progressive review, prologue – This is the beginning of my first progressive review for The Game Chair, of the interactive drama Façade. Also see parts one and two.