On Fri, 20 Aug 2010 05:28:42 pm nitin chandra wrote: > try: > fp6 = open(FileA,'r') > except IOError: You need to outdent the except line: try: fp6 = open(FileA,'r') except IOError: sys.exit('Could not open file: %s' % FileA) -- Steven D'Aprano