What is Python?
Python is a programming language. I have collected some scripts here because I have frequently found similar collections of scripts useful when I seek an example of using a library or a starting point to build on top of. Some of the other software I have written is also in Python. This page just scripts or modules too small or unpolished to justify a "real" release.
Python libraries and tools
Many of the scripts below use one or more of the following libraries made by other people.
- Python Imaging Library (PIL): Image manipulation supporting lots of image types. Very handy and also free. There's a commercial version of this library which has some more features, but I have never used it.
- pygame: Game development library for Python. It is built on top of SDL. Most of my use of pygame has been as a very convenient way to show full screen images on Windows.
- Pyrex: A tool for writing C Python extension modules in a Python-like language.
- ReportLab Toolkit: Library for creating PDFs.
Code
All of the raw scripts have the extension .script here but they should be saved with the extension .py. I post them as .script so no web server I happen to use ever gets confused and tries to execute them as CGI.
- Rounded corner images (PIL)
- That post describes how I generated some rounded corner images, including a Python Image Library (PIL) wielding script to make colored corner images.
- Merge image with background (PIL)
- Generating header images. The python script, merge.py, uses PIL to combine a frame, photo, and some text into a instant-camera-photo-looking header. It's another example of using PIL.
- PDF from images
- imagepdf.py assembles a PDF from a bunch of JPEGs, using IPTC data for captions and ordering (by date). This depends on part of Singleshot to read the IPTC data.
- libuuid wrapper
- I wrote uuids.pyx mostly to play with Pyrex, but it can be handy anyway. It exposes a generate_uuid function from libuuid library.