?
=?ISO-8859-1?Q?Gregory_Pi=F1ero?=
Hi Guys,
I'm sure this is documented somewhere, I just can't locate it. Say I
have this code:
try:
myfile=file('greg.txt','r')
except IOError, error:
#now psuedo code because this is what I'm trying to figure out
if error.errno=='file doesn't exist':
do something
elif error.errno=='no permissions':
do something else
.... and so on
So basically I'm looking for the document that tells me what possible
errors I can catch and their numbers.
I did find this but it doesn't have numbers and I can't tell if it's
even what I'm looking for:
http://docs.python.org/lib/module-errno.html
Much thanks!
I'm sure this is documented somewhere, I just can't locate it. Say I
have this code:
try:
myfile=file('greg.txt','r')
except IOError, error:
#now psuedo code because this is what I'm trying to figure out
if error.errno=='file doesn't exist':
do something
elif error.errno=='no permissions':
do something else
.... and so on
So basically I'm looking for the document that tells me what possible
errors I can catch and their numbers.
I did find this but it doesn't have numbers and I can't tell if it's
even what I'm looking for:
http://docs.python.org/lib/module-errno.html
Much thanks!