One of the most often read postings on this blog is the one about my getopts-enabled shell script template. So I figured, a similar template in Python would also be useful. Like the shell script, it’s quite trivial, but it might still save some time.
Archive for the 'python' Category
A Template for Python Unix Utilities
October 24, 2009Quick Tip #3: Creating Histograms in Python
September 10, 2009Since Python 2.5, creating histograms has become easier. Instead of dict, we can now use defaultdict which is similar in behavior to awk’s associative arrays. Instead of raising a KeyError for undefined keys, defaultdict adds a user-defined item and returns it.
Django on Google App Engine
February 22, 2009I’m back to playing with the Django web development framework again. Since I’m close to putting something online (it’s only a matter of years, actually), I’m also looking into hosting options. Due to the framework choice, Google App Engine appeared on my radar and I had a quick look at it.
Transcoding Files to Ogg Vorbis
June 21, 2008I’ve got a nice MP3 player from Samsung with 2 GB of flash memory. That’s very little and I can never decide which files to keep and which to delete. Fortunately, the player also supports Ogg Vorbis files that require less space for the same quality. To make the most of my space, I transcode [...]
Using ReStructured Text with WordPress
March 22, 2008Writing long documents in a browser input box isn’t the most pleasant thing to do. The WordPress builtin editor makes things even more inconvenient by forcing you to write your articles in HTML. It would be pretty cool if you could edit articles in a simple, readable format using your favorite text editor. Fortunately, there’s [...]
Map/Reduce in Python
October 28, 2007My interest in Grid Computing over the last weeks begins to show. After reading the Google MapReduce paper, I tried my fingers on a client side toy problem.
For formatting purposes, I was interested in the size of the longest string in a sequence. There are lots of ways to do this, but I wanted to [...]
Writing a Minimal Web Server in Python
February 3, 2007Copying files from one host in your home network to another is easy using protocols like NFS or SMB. But if you just want to transfer a couple of files to a friend’s computer in a foreign network, you have a lot of setup work to do (at least on Linux boxes). It would be [...]
Controlling Firefox via Command Line
January 5, 2007Mozilla-based browsers like Firefox have inherited a useful feature from the good old Netscape Navigator: Controlling a running browser instance via the command line. Using command line options, you can open URLs or files inside your browser window without having to enter them in the address bar.