Exception Handling
Chris Angelico
rosuav at gmail.com
Fri Apr 10 05:00:01 EDT 2015
On Fri, Apr 10, 2015 at 6:39 PM, Palpandi <palpandi111 at gmail.com> wrote:
> Thanks for your responses. And I have one more question.
>
> This is the situation. A python application which reads data from one .xml file and generates some other file. Here what kind of exceptions occur?
All sorts of exceptions. The best way to find out is to write your
code without any try/except clauses, and then run it. When an
exception happens, it'll be printed out on the console, and the
program terminated. Then you can decide how your program should cope
with that. Catch an exception *only* if you can actually deal with it
inside your code; otherwise, just let it bubble up.
ChrisA
More information about the Python-list
mailing list