Polyglot 6: Python
18 September 2004
Sixth is Python. Good general-purpose language. If there isn't a language which specialises in the desired task (high‑level → Lisp; speed → C; multiuser → Moo) then Python is usually a safe bet. The biggest downside is that when compared with other languages, the documentation is poorly organised and poorly written. The docs are so bad that the only way I could write this application was to dissect the C source code. I'd argue that the 'Python Paradox'[?] is actually caused by everyone but the most determined programmers switching to languages which are properly documented.
Here's the Python source code of the standard colour program. Due to pathetic programming within the Python-GD interface, images are limited to a maximum of 256 colours. Worst implementation yet, and the one that took the longest to program too.
Update from 2019. Obviously the world has changed a lot since this post was written. Python has matured into a friendly and well-documented language. Furthermore, the Python Imaging Library (PIL) can create full-colour images. To the left is a live execution of the PIL version of the colour program (reload for a different pattern). Python source code
On an unrelated issue, let's play with fire:
What do they all do? Blow up, obviously. But how they do it is interesting.
[Richard, don't even think about it. I know where you live.]