I thought it might look like this but I am unsure:
example = open("example.txt","r")
if example #has text1 in it then#: <-- What do I need to put between the #'s for the code to work?
I thought it might look like this but I am unsure:
example = open("example.txt","r")
if example #has text1 in it then#: <-- What do I need to put between the #'s for the code to work?
import re
wordChk = re.compile(r'(.*)?text1(.*)?')
fileName=open("d:/foo.bar")
lines = [i for i in fileName.readlines()]
for x in lines:
if wordChk.match(x):
do something