Some handy python code.