On Oct 10, 12:28 pm, Paul Hankin <[EMAIL PROTECTED]> wrote:
> On Oct 10, 7:41 pm, wink <[EMAIL PROTECTED]> wrote:
>
> > I would like to know what would be considered the most
> > Pythonic way of handling errors when dealing with files,
> > solutions that seem reasonable using 2.5:
>
> The best way
On Oct 10, 7:41 pm, wink <[EMAIL PROTECTED]> wrote:
> I would like to know what would be considered the most
> Pythonic way of handling errors when dealing with files,
> solutions that seem reasonable using 2.5:
The best way to handle errors is to catch the exceptions that are
raised by the code t
Hello,
I would like to know what would be considered the most
Pythonic way of handling errors when dealing with files,
solutions that seem reasonable using 2.5:
---
try:
f = open('afile', 'r')
content = f.read()
error = 200
except Exception:
error = 404
finally:
if locals().has