[Tutor] Searching list items.

Chris Hengge pyro9219 at gmail.com
Tue Oct 17 23:59:10 CEST 2006


An article at devshed was using it like that... but the output wasn't what I
was looking for.. I was getting the hex address where the result was, but
not printing the line..

I think the simple code you recommended in your first reply will do the
trick, I'm not looking for anything magical, just need to see a line if it
contains what I'm looking for.

I'll do some more checking into regex later, looks very useful...

Thanks.

On 10/17/06, Luke Paireepinart <rabidpoobear at gmail.com> wrote:
>
> Chris Hengge wrote:
> > I remove those lines, but I was trying to use
> > for line in contents:
> >     result = re.search("something", line)
> >     print result
> I'm pretty sure this isn't how you use regular expressions.
> I have to go to class right now but if no one else has replied when I
> get back I'll look into it.
> Sorry I can't help right now.
> -Luke
> >
> > this printed out something like
> >
> > None
> > None
> > None
> > hex memory address of goodness
> > None
> > None
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061017/417a3a3a/attachment.htm 


More information about the Tutor mailing list