I am reading a file with a different string on each line. I want to be able to search an input string for a substring that matches an entire line in the file and then save that substring so that it can be printed. This is what I have right now:
wordsDoc = open('Database.doc', 'r', encoding='latin-1')
words = wordsDoc.read().lower()
matching = [string for string in words if string in op_text]
But this matches on each character. How would I do this properly?
cardsDoc = wordsDoc?