[Tutor] IOError exception handling

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 28 Jul 2002 17:48:41 -0700 (PDT)


> As you can see, IOError covers many issues
>
> >>> try:
> ...   fd = open('/home/shoon/xinitrc')
> ... except IOError, e:
> ...   print e[0], e[1]
> ...
> 13 Permission denied
>
> I am sure there is a wrapper for errno somewhere in python.

Here you go:

    http://www.python.org/doc/lib/module-errno.html


Hope this helps!