Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

print next line

# with Regular Expression 
import re

fruit_list = open('test.txt')
search_words = ['apple', 'banana', 'orange', 'lemon']

patten = re.compile("(.*(apple|banana|orange|lemon)(.*))")

for i in [re.search(patten,line).groups() for line  in      fruit_list  if re.search(patten,line) != None]: print(i)
Comment

PREVIOUS NEXT
Code Example
Python :: python file browser 
Python :: python to pseudo code converter online 
Python :: how to change directory in python 
Python :: shape of a dataframe 
Python :: python remove list from nested list 
Python :: unban member using ID discord.py 
Python :: pandas first row to header 
Python :: how to get user input in python 
Python :: matplotlib show image black and white 
Python :: signup view django 
Python :: get member by id discord py 
Python :: django datefield year only 
Python :: python http server 
Python :: show post id on django admin interface 
Python :: python oneline if 
Python :: pyplot.plot 
Python :: convert files to jpeg 
Python :: set password django 
Python :: python group by 
Python :: np.pad 
Python :: python inherit from objects 
Python :: how to duplicate a list in python 
Python :: adding an item to list in python 
Python :: how to run a python package from command line 
Python :: convert birth date column to age pandas 
Python :: how to make an argument optional in python 
Python :: min max code in python 
Python :: how to create multiple dictionaries in python 
Python :: grab the first letter of each string in an array python 
Python :: python discord bot embed 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =