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? Answer:
thanks to the many people who wrote about
Ping-o-matic; doesn’t quite fit our
bill, but interesting.)
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.