Re: Resuming a program's execution after correcting error
- From: Tuomas <tuomas.vesterinen@xxxxxxxxxx>
- Date: Thu, 28 Sep 2006 17:27:38 GMT
Sheldon wrote:
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.
May be you could put some parameter to your main loop:
start_point=begin
if start_point==begin: output=open('outputfile', 'w')
else : output=open('outputfile', 'a')
while start_point <= case <= end_point:
try:
do_complex_computation(case)
except Exception:
print case
break
If you get an error you repair the program and set
start_point=case
and go on with the program.
Tuomas
.
- References:
- Resuming a program's execution after correcting error
- From: Sheldon
- Resuming a program's execution after correcting error
- Prev by Date: Re: help tranlating perl expressions
- Next by Date: Re: Resuming a program's execution after correcting error
- Previous by thread: Re: Resuming a program's execution after correcting error
- Next by thread: Re: Resuming a program's execution after correcting error
- Index(es):