Re: [Tutor] Clean up loop and search in a list

2005-10-13 Thread Kent Johnson
Markus Rosenstihl wrote: > Thank you for the fast reply > > Am 13.10.2005 um 19:43 schrieb Kent Johnson: > > > >> if len(filter(re_name.search, line)) > 0: >>could be written >> if re_name.search(line): > > > this is not working because I am parsing a line in a list (i think): Ah, sorry,

Re: [Tutor] Clean up loop and search in a list

2005-10-13 Thread Markus Rosenstihl
Thank you for the fast reply Am 13.10.2005 um 19:43 schrieb Kent Johnson: > if len(filter(re_name.search, line)) > 0: > could be written > if re_name.search(line): this is not working because I am parsing a line in a list (i think): Traceback (most recent call last): File "telekom2.py

Re: [Tutor] Clean up loop and search in a list

2005-10-13 Thread Kent Johnson
Markus Rosenstihl wrote: > Hi, > I wrote a program (see below) to analyse my phone bill, which is shared > by three others and I don't know if there is a way to make lines like > this nicer: > if len(filter(re_name.search, line)) > 0 and len(filter(re_misc.search, > line)) == 0 if len(filter

[Tutor] Clean up loop and search in a list

2005-10-13 Thread Markus Rosenstihl
Hi, I wrote a program (see below) to analyse my phone bill, which is shared by three others and I don't know if there is a way to make lines like this nicer: if len(filter(re_name.search, line)) > 0 and len(filter(re_misc.search, line)) == 0 Is there for example a way to search the whole list