movieFile = open( PATH + MOVIE_FILE ) regex = re.compile( titleRegex + weirdShitRegex + splitRegex + '(\d{4})$', re.VERBOSE) nMovies = 0 for line in movieFile: matches = regex.match(line) if(matches and matches.group(1) and not matches.group(2) and not matches.group(3)): if(matches.group(1) in titles): try: s.addMovie(matches.group(1),matches.group(4)) nMovies += 1 foundTitles.append(matches.group(1)) #print matches.group(1) except: print matches.group(1) + " FAILED" print "FINISHED PARSING MOVIES : " + str(nMovies) titles = foundTitles #------------------------------------------------------------------------------------- #ACTORS actorFile = open( PATH + ACTOR_FILE )