On rapid iteration

I think that one of the great strengths of interpreted languages like Python is the ability to iterate rapidly, due to the lack of a compilation step. I've been reading Richard Feynmann's fascinating reminiscences in Surely You're Joking, Mr. Feynmann. The entire text is available online. One passage that really struck me was where he […]

mailer version 0.5 released

I've released version 0.5 of my mailer python module for sending emails. Thanks to a patch from Douglas Mayle, this version makes it possible to send HTML emails with attachments (previous versions only let you do one or the other). Project homepage pypi page

Converting kanji numbers to integers with Python

A question on StackOverflow about converting kanji numbers (e.g. "五十五") into integers in C++ got me interested in solving this using Python. The result is my kanjinums module, with a function kanji2num that will convert a string containing a kanji num to a Python integer. Download the source distribution (kanjinums-0.1.zip) Download the Windows installer (kanjinums-0.1.win32.exe) […]

Inno Setup: Determining the data directory at install time

Inno Setup is a fantastic and free application for creating Windows setup programs. It takes so much of the hassle out of the process that it's almost fun. I recently needed to extend Inno Setup with a custom code section: I needed to install the program's data to the Common App Data folder or the […]

Version 0.2 of mailer module released

I updated my mailer module (blogged about here) to version 0.2, and also uploaded it to pyPI. Improvements in this version: Default arguments in Message.__init__() method Support for non-ascii charsets (in body and subject) Support for Python 2.4 With the support for non-ascii encodings, you can now do this: from mailer import Mailer from mailer […]

The Adapter Pattern in Python

Interface mismatches are one of the banes of code reuse. You want to integrate component A and component B into your program, but component A expects a method called half_empty() while component B only has a method called half_full(). The Gang of Four (GoF) Adapter pattern is used to convert the interface of an object […]

A module to send email simply in Python

Update: I've released version 0.3 of the mailer module. See the mailer home page for details and the latest version. The email and smtplib modules in Python are very powerful, but they're also a bit complex when you just want to send an email. I wrote the mailer module as a front end to these […]

Conditional “tee” with Python

This post describes the conditional tee ("ctee") module I wrote to split a sequence into two generators, according to a filter function. The problem David Beazley has a great article about generator pipelining using Python. This is a technique for handling (potentially very large) streams of data in a flexible yet efficient way. As an […]

Coming from C++/Java to Python should bend your mind

Coming from C++ or Java to Python should bend your mind. If it doesn't, then you haven't learned Python yet — you're just writing C++ or Java in Python. If you only knew a statically typed and compiled language like C++ or Java before, and learning Python hasn't changed the way you think about programming, […]

Qt to be released under LGPL

The news that Qt will be released under the LGPL is taking the micro-ISV (mISV) world by storm. Qt is a cross-platform GUI framework that was recently bought out by Nokia. Until now, Qt has been dual licensed under a commercial license and the GPL. That wasn't very popular with mISVs, because the commercial license […]