Category Archives: Python

Updatable Diagrams with Inkscape and Python

TL;DR: To create diagrams that can be updated from data in a file, I used Inkscape to create the layout, labelled all the diagram elements I want to update, put the data into a CSV file and used some Python code (with the ElementTree XML API) to update the SVG file.

I’ve been experimenting with a new project, WorldCupWallCharts.com (update: now defunct!). It’s a site where I create PDF wall charts that people can download and print out, to help them follow major sporting tournaments. It’s not really a development project, but I still found a way to write some code while working on it recently 🙂

cricket

All the text elements on this diagram were typed in by hand…

Continue reading

A Few Notes on Python’s Built-In Container Types

I’ve been learning Python recently, as I’m planning to use it for some future projects. One of the things I’ve initially found a bit confusing is the different types of built-in containers that Python provides: Lists, Tuples, Sets and Dictionaries. So this post is just a few notes for myself on how these work and what they’re useful for. There’s nothing here that you can’t get from the excellent documentation at https://docs.python.org.jar Continue reading