Python Patchwork program for INTPROG 2012