exception you are anticipating : Read : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Read »

 

exception you are anticipating


try:
   filename = 'file.txt'
   fobj = open(filename, 'r')
   for eachLine in fobj:
       print eachLine,
   fobj.close()
except IOError, e:
     print 'file open error:', e



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Read