[Tutor] Multiple file open

Alan Gauld alan.gauld at btinternet.com
Fri Aug 20 09:58:56 CEST 2010


"nitin chandra" <nitinchandra1 at gmail.com> wrote 

> FileA = raw_input('Enter CSV file with lists of Files:')
> try:
>   fp6 = open(FileA,'r')
>   except IOError:
> 
> ##  I am getting the following error at this line:-
> ##
> ##    File "mer5Pr2.py", line 7
> ##    except IOError:
> ##            ^
> ##    SyntaxError: invalid syntax


The except needs to align with the try.


   try:
      #code here
   except:

HTH


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list