Resuming a program's execution after correcting error
MRAB
google at mrabarnett.plus.com
Thu Sep 28 18:46:57 EDT 2006
Sheldon wrote:
> Hi.
>
> Does anyone know if one can resume a python script at the error point
> after the error is corrected?
> I have a large program that take forever if I have to restart from
> scratch everytime. The error was the data writing a file so it seemed
> such a waste if all the data was lost and must be recalculated again.
>
You could modify the program while you're debugging it so that instead
of, say:
calculate data
write data
you have:
if saved data exists:
load data
else:
calculate data
save data
write data
The pickle module would be useful here.
Matthew
More information about the Python-list
mailing list