Assorted Python code.