Python: Filter lines from a text file which contain a particular word,[line for line in open('textfile') if 'apple' in line]