files and exceptions not working python

Solutions on MaxInterview for files and exceptions not working python by the best coders in the world

showing results for - "files and exceptions not working python"
Luca
19 Jul 2018
1try:
2    f = open(fname, 'rb')
3except OSError:
4    print "Could not open/read file:", fname
5    sys.exit()
6
7with f:
8    reader = csv.reader(f)
9    for row in reader:
10        pass #do stuff here
11
similar questions
queries leading to this page
files and exceptions not working python