Resurrect old Chapter 12 scripts for Python <3.4