nWrites = 0 for line in writersFile: 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.addWriter(clean, matches.group(2)) nWrites += 1 except: continue # print writerName + " ::: " + matches.group(2) print "FINISHED PARSING WRITERS : " + str(nWrites) #-------------------------------------------------------------------------------------- #DIRECTORS directorsFile = open( PATH + DIRECTOR_FILE ) nDirects = 0