Pre-defining an action to take when an expected error occurs

Gabriel Genellina gagsl-py at yahoo.com.ar
Thu Sep 14 23:19:51 EDT 2006


At Thursday 14/9/2006 23:40, Tempo wrote:

>Hello. I am getting the error that is displayed below, and I know
>exactly why it occurs. I posted some of my program's code below, and if
>you look at it you will see that the error terminates the program
>pre-maturely. Becasue of this pre-mature termination, the program is
>not able to execute it's final line of code, which is a very important
>line. The last line saves the Excel spreadsheet. So is there a way to
>make sure the last line executes? Thanks in advanced for all of the
>help. Thank you.

You want a try/finally block.
Read the Python Tutorial: http://docs.python.org/tut/node10.html



Gabriel Genellina
Softlab SRL 


	
	
		
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas




More information about the Python-list mailing list