Posts tagged: PYTHON

Django: less (magic) is more

Today I updated my Django play/development environment to the new magic-removal branch, and migrated my proto-wiki as an exercise. Following the RemovingTheMagic instructions on the official Django wiki made it fairly easy. (I added some notes on dealing with custom template tags.)

This branch is about more than cleaning up some of the needlessly clever bits found in earlier implementations; it also has some really nice syntax refinements. Compare this:

reporters.get_list(fname__exact='John', order_by=('lname',))

to this:

More mobile Python options

As a Palm-wielding Python guy, I took news of the Python port for the iPod as another cruel slap. I use Pippy, but being Python 1.5.2 it’s pretty limited. The increased power (and screen real estate) of the TX over previous Palms I’ve had has made me more desirous of having an actual programming environment. There are ports for Zaurus, EPOC, and Nokia Series 60 phones (which I mentioned last summer). It’s sinking in that things aren’t likely to change until the faraway Linux-based PalmOS arrives.

Soft launch

I quietly launched my first production Django site today, a replacement for a mess of legacy third-party PHP code. Unfortunately, it’s a members-only service related to my job and so I don’t have a public URL to share.

A couple interesting points: the new site was developed alongside the still-live legacy PHP apps, using some of the same data – including a user table that’s used for authentication. django-admin.py inspectdb made model creation fairly easy. I also found Scott Hurring’s PHPSerialize module indispensible for working with the highly crufty legacy data.

Let's play a game: BASIC vs. Ruby vs. Python vs. PHP

In November I wrote about rediscovering BASIC Computer Games, a book I had when I was learning programming in the ’80s. Flipping through it recently I came across a simple game called “Reverse”:

The game of REVERSE requires you to arrange a list of numbers in numerical order from left to right. To move, you tell the computer how many numbers (counting from the left) to reverse. For example, if the current list is 2 3 4 5 1 6 7 8 9 and you reverse 4, the result will be 5 4 3 2 1 6 7 8 9. Now if you reverse 5, you win.

IronPython 1.0 beta

ironpython logo A few days ago the first 1.0 beta of IronPython was released.

If you’ve been wondering about IronPython you should definitely check out Jim Hugunin’s screencast from November (use the direct link to the video if you are on a Mac). If I were a Windows developer, I’d be really excited by this. In particular being able to use the Avalon GUI framework from Python seems very slick and simple. The integration with Visual Studio for debugging is quite nice too.