[EMAIL PROTECTED] wrote:

>I should have also said that I am using the same file handle.
> So suppose the file handle is fp
> then I read some lines from fp and I hand it over to other
> functions that read other things from fp (in an ordered manner).

another part of your program?  so why not use one of the wrappers
that people have posted?  or just pass the extra line to the next step:

    while 1:
        s = file.readline()
        if not s or s[0] == "#":
            break
        # process lines that belong to section 1

    while 1:
        # process lines that belong to section 2
        if not s or s[0] == "#":
            break
        s = file.readline()

    (etc)

</F> 



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to