Notebook
Odds and ends that I want to hang on to

Tuesday, July 6, 2004

Bray on writing Python

I just wrote my first Python program. It occurs to me, given the generally grey colour of my beard, that this may be the last time I learn a new programming language. Which, frankly, would be OK, it’s real work. This thing scans all the feeds coming out of Planet Sun using Mark Pilgrim’s Universal Feed Parser, detects any that have changed in the last day, and pings weblogs.com, technorati.com, and blo.gs to let them know. (Question: who else should be pinged?) It’s only 57 lines of code, but I had to learn a modest amount of Web wrangling, string munging, time arithmetic, and data structure walking to get it going. I suspect it’s not a very good Python program, but I can live with that. If you’re going to scale the Pythonic slopes, you’ll need one browser tab open to Dive Into Python, another to the Python Tutorial, a shell window handy where you can type things like pydoc time, and a nontrivial chunk of Python code in a nearby editor buffer (I used the Feed Parser) so you can look up idioms. At the end of the day, the code looks distinctly weird to my eye, kind of ragged without a supporting visual lattice of {’s }’s, and ;’s. But I’m sure you get used to it quickly. [ongoing]


8:50:07 PM     trackback [] 

July 2004
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jun   Aug


Walden Pond, circa 1950

Nearwalden
Weblog Home
Stories
RFID
Infrastructure
Notebook
Ozzie
Scripting
Lessig
Udell
Patrick
Allaire
McDowell


Think!

Click here to visit the Radio UserLand website.

Click to see the XML version of this web page.

Subscribe to "Notebook" in Radio UserLand.

Click here to send an email to the editor of this weblog.

beowulfAlt theme


© Copyright 2005, David Douglas.
Last update: 7/26/05; 10:44:49 PM.