cactus wrote:ps. I am new to python too.
as am I - it's funny to see how long python has been around...
me three
and cactus, they call it a list because a list can have multiple types in it, whereas an array implies a single type.
list sounds cooler too
]]>ps. I am new to python too.
as am I - it's funny to see how long python has been around...
]]>import re
r=open('/var/log/pacman.log','r')
log = r.read()
r.close()
rexp = re.findall('^.*installed.*$',log,re.M)
##rexp is now a list of install lines.
print rexp
ps. I am new to python too.
]]>I'm using code something like this, I want to get a list of what was installed and when.
import re
r = open('/var/log/pacman.log')
log = r.read()
r.close()
exp = re.compile('[(.+)] installed (.+)', re.MULTILINE)
prnt exp.match(log)
Every time it prints 'None" which isn't what I'm after. Basic debugging says log contains the data I'm chasing. Any tips would be greatly appreciated.
Thanks
]]>