Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

files and exceptions not working python

try:
    f = open(fname, 'rb')
except OSError:
    print "Could not open/read file:", fname
    sys.exit()

with f:
    reader = csv.reader(f)
    for row in reader:
        pass #do stuff here
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #files #exceptions #working #python
ADD COMMENT
Topic
Name
7+8 =