Steven D'Aprano wrote:
> On Wed, 06 May 2009 20:21:38 -0700, TomF wrote:
>
>>> The only reason you would bother going to the time and effort of
>>> catching the error, printing your own error message, and then exiting,
>>> is if you explicitly want to hide the traceback from the user.
>> Well, to
On 2009-05-07 01:01:57 -0700, Peter Otten <__pete...@web.de> said:
TomF wrote:
As a relative newcomer to Python, I like it a lot but I'm dismayed at
the difficulty of handling simple errors. In Perl if you want to
anticipate a file-not-found error you can simply do:
open($file) or die("open
On Wed, 06 May 2009 20:21:38 -0700, TomF wrote:
>> The only reason you would bother going to the time and effort of
>> catching the error, printing your own error message, and then exiting,
>> is if you explicitly want to hide the traceback from the user.
>
> Well, to me, exposing the user to suc
> If it fails, you get both a straight-forward error message and a useful
> traceback:
>
> Traceback (most recent call last):
> File "", line 1, in
> IOError: [Errno 2] No such file or directory: 'foomanchu'
>
>
> The only reason you would bother going to the time and effort of catching
> the err
TomF wrote:
> As a relative newcomer to Python, I like it a lot but I'm dismayed at
> the difficulty of handling simple errors. In Perl if you want to
> anticipate a file-not-found error you can simply do:
>
> open($file) or die("open($file): $!");
>
> and you get an intelligible error message
On 2009-05-06 19:41:29 -0700, Steven D'Aprano
said:
On Wed, 06 May 2009 16:40:19 -0700, TomF wrote:
As a relative newcomer to Python, I like it a lot but I'm dismayed at
the difficulty of handling simple errors. In Perl if you want to
anticipate a file-not-found error you can simply do:
op
On Wed, 06 May 2009 16:40:19 -0700, TomF wrote:
> As a relative newcomer to Python, I like it a lot but I'm dismayed at
> the difficulty of handling simple errors. In Perl if you want to
> anticipate a file-not-found error you can simply do:
>
> open($file) or die("open($file): $!");
>
> and y
As a relative newcomer to Python, I like it a lot but I'm dismayed at
the difficulty of handling simple errors. In Perl if you want to
anticipate a file-not-found error you can simply do:
open($file) or die("open($file): $!");
and you get an intelligible error message. In Python, to get the