start reading from certain line

Iain King iainking at gmail.com
Thu Jul 10 17:56:20 CEST 2008


On Jul 10, 4:54 pm, Iain King <iaink... at gmail.com> wrote:
> On Jul 10, 2:45 pm, jstrick <jstr... at mindspring.com> wrote:
>
> > Here's a simple way to do it with a minimum amount of loopiness (don't
> > forget to use 'try-except' or 'with' in real life):
>
> > f = open("item1.txt")
>
> > for preline in f:
> >     if "Item 1" in preline:
> >         print preline,
> >         for goodline in f:
> >             # could put an end condition with a 'break' here
> >             print goodline,
>
> > f.close()
>
> No

Ignore that



More information about the Python-list mailing list