I have a list of article titles that I store in a text file and load into a list. I'm trying to compare the current title with all the titles that are in that list like so
def duplicate(entry):
for line in posted_titles:
print 'Comparing'
print entry.title
print line
if line.lower() == entry.title.lower()
print 'found duplicate'
return True
return False
My problem is, this never returns true. When it prints out identical strings for entry.title and line, it won't flag them as equal. Is there a string compare method or something I should be using?
Edit
After looking at the representation of the strings, repr(line) the strings that are being compared look like this:
u"Some Article Title About Things And Stuff - Publisher Name"
'Some Article Title About Things And Stuff - Publisher Name'
repr()unicode.