> On 7 Sep 2019, at 16:33, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> 
> wrote:
> 
>    with fileinput ...:
>        for line in f:
>            if fileinput.isfirstline():
>                headers = extract_headers(line)
>            else:
>                pass # process a non-header line here

If you always know you can skip the first line I use this pattern

with fileinput ...:
    next(f) # skip header
    for line in f:
        # process a non-header line here

Barry
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to