nDirects = 0 for line in directorsFile: matches = regex.match(line) if(matches and len(matches.group(1)) != 0): actorName = matches.group(1) addedPerson = False if(matches and matches.group(2) and not matches.group(3) and not matches.group(4)): try: if(matches.group(2) in titles): if(not addedPerson): clean = cleanName(actorName) s.addPerson(clean) addedPerson = True s.addDirector(clean, matches.group(2)) nDirects += 1 except: continue # print directorName + " ::: " + matches.group(2) print "FINISHED PARSING DIRECTORS : " + str(nDirects) #-------------------------------------------------------------------------------------- #GENRES genresFile = open( PATH + GENRE_FILE ) regex = re.compile(titleRegex + weirdShitRegex +