[Tutor] findall() (original) (raw)
Alan Gauld alan.gauld at blueyonder.co.uk
Sat Jul 3 19:10:49 EDT 2004
- Previous message: [Tutor] findall()
- Next message: [Tutor] complex iteration over a list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
def getlog(activity,type,endtype): log = open("MultivertLog.txt","r") for line in log.readlines(): ac = re.compile(activity)
This creates an re object so you want to call the findall method of the ac object
fac = re.findall(ac, line)
So this becomes fac = ac.findall(line)
Same with the ty and ex bits further down.
Alan G.
- Previous message: [Tutor] findall()
- Next message: [Tutor] complex iteration over a list
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]