txt = f.read() txt = re.sub('[,\.()":;!@#$%^&*\d]|\'s|\'', '', txt) word_list = txt.replace('\n',' ').replace(' ',' ').lower().split(' ')