how to suspend program and save state data in python or IDLE?

Chris Rebert crebert at ucsd.edu
Sat Apr 25 18:26:08 EDT 2009


On Sat, Apr 25, 2009 at 3:18 PM,  <james at biosci.utexas.edu> wrote:
> hi! i'm running computationally-intensive python programs for a student
> project, and i have a couple of questions.
>
> 1) how can i suspend program execution for brief periods either in python or
> through IDLE;

Ctrl+Z on Unix shells will stop program execution and return you to
the shell. The command `fg 1` will resume execution.

>
> and 2) is there a way to save state data so that if i have to quit running a
> program in a student computer lab, i can write the state of the program and
> all intermediate data to -- say -- a usb drive, then read in the state data
> later so the program can pick up where it left off?

http://docs.python.org/library/pickle.html

Cheers,
Chris
-- 
I have a blog:
http://blog.rebertia.com



More information about the Python-list mailing list