Tuesday, June 07, 2011

Creating images of python code + pygments = WIN!


Posted a short script to http://paste.pocoo.org/show/402065/

Output PNG files using Pygments for the python code in a directory (used it for short snippets used in a presentation) :)

(edit: Thanks to Marius for suggesting a sample.)

Sample has one function highlighted (any line you want highlighted put ## at the end of the line).

Currently the script has very few options - just what I needed RIGHT NOW :)