title: Saving the state of a program to allow it to be resumed
body: <p>I occasionally have Python programs that take a long time to run, and that I want to be able to save the state of and resume later. Does anyone have a clever way of saving the state either every x seconds, or when the program is exiting?</p>