Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #102920

Re: ftplib throws: IndexError: tuple index out of range

From Antoon Pardon <antoon.pardon@rece.vub.ac.be>
Newsgroups comp.lang.python
Subject Re: ftplib throws: IndexError: tuple index out of range
Date 2016-02-14 19:23 +0100
Message-ID <mailman.115.1455474240.22075.python-list@python.org> (permalink)
References <56C05CEF.5080304@rece.vub.ac.be> <n9q04l$ese$1@ger.gmane.org>

Show all headers | View raw


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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: ftplib throws: IndexError: tuple index out of range Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-02-14 19:23 +0100

csiph-web