'''
This code use exception handling syntax
'''
directory ="C:/pythonInputFile.txt"
try:
f=open(directory,'r')
print f.read()
f.close()
except:
print "File not found/problem on reading file"
finally:
print "It always works"
Friday, August 20, 2010
python exception handling
Posted by
Abu Zahed Jony
at
12:29 PM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels:
Exception
Subscribe to:
Post Comments (Atom)

0 comments:
Post a Comment