Páginas

lunes, 11 de mayo de 2015

Python: Como imprimir los errores en el programa

 
Así de sencillo, con el modulo "traceback":  
 
import traceback
try:
    for a in 10:
        print 'hello'
except:
    print 'the following error occured: '
    traceback.print_exc()
    raw_input()

No hay comentarios:

Publicar un comentario