ftplib throws: IndexError: tuple index out of range

Antoon Pardon antoon.pardon at rece.vub.ac.be
Sun Feb 14 13:23:57 EST 2016


Op 14-02-16 om 14:40 schreef Peter Otten:

> 
> PS: How did you produce the overview over the local variables? That looks 
> nice.
> 

I started from this recipe: http://code.activestate.com/recipes/52215-get-more-information-from-tracebacks/
made it more to my liking and turned it into a module. So that instead of a program being run like this:

def program(argv):
    ...

if __name__ == '__main__':
    program(sys.argv)


I start it now like this

from pymain import main

def program(argv):
   ...

if __name__ == '__main__':
    main(program)


pymain.main will then trap almost all exceptions and produces the overview over
the local variables.

-- 
Antoon.


More information about the Python-list mailing list