More Python posts
October 28, 2002
More bulk file renames

Jarno Virtanen has a much nicer pythonization of the elisp bulk file rename script here. As he says, his looks much more Pythonic. Mine was a literal translation from an elisp semi functional approach using the same constructs.

I'll try rewriting the perl in a more perlish style later. Probably involve using foreach $f (readdir(DIR)) as an outer loop rather than trying a functional approach. Of course it's also possible to write the elisp as an imperative loop rather than in a semi functional style.

It's interesting that once I had a solution it was easy to produce a literal translation, but it didn't occur to me to recast the problem using a different approach. If I'd have started with a Python script would I have written the elsip using dolist or while?

Posted by Alex at October 28, 2002 08:28 AM
Comments
Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?