Elwin Estle wrote:
Tcl's list search command has the option to search for a list element
that matches a given regex. Is there something similar in python?
Not using regexes.
If not, it seems like it should be fairly trivial for me to write my
own (just wondering if I would be re-inventing t
Alan Gauld wrote:
"Elwin Estle" wrote
parse various text files and my standard method is to
slurp the whole thing up into a string variable, then
break it up into a list that I can then work on
If you read it with readlines() Python will do all of
that for you...
Very true, and it's a go
--- On Mon, 1/31/11, Alan Gauld wrote:
> From: Alan Gauld
> Subject: Re: [Tutor] search list with regex
> To: tutor@python.org
> Date: Monday, January 31, 2011, 3:29 PM
>
> "Elwin Estle"
> wrote
>
> > parse various text files and my standard method i
"Elwin Estle" wrote
parse various text files and my standard method is to
slurp the whole thing up into a string variable, then
break it up into a list that I can then work on
If you read it with readlines() Python will do all of
that for you...
HTH,
--
Alan Gauld
Author of the Learn to P
--- On Mon, 1/31/11, Wayne Werner wrote:
From: Wayne Werner
Subject: Re: [Tutor] search list with regex
To: "Elwin Estle"
Cc: tutor@python.org
Date: Monday, January 31, 2011, 10:20 AM
On Mon, Jan 31, 2011 at 7:07 AM, Elwin Estle wrote:
Tcl's list search command has the o
On Mon, Jan 31, 2011 at 7:07 AM, Elwin Estle wrote:
> Tcl's list search command has the option to search for a list element that
> matches a given regex. Is there something similar in python? If not, it
> seems like it should be fairly trivial for me to write my own (just
> wondering if I would
Tcl's list search command has the option to search for a list element that
matches a given regex. Is there something similar in python? If not, it seems
like it should be fairly trivial for me to write my own (just wondering if I
would be re-inventing the wheel).