read a files particular line

Michael Hudson mwh at
Thu Oct 14 17:10:44 CEST 2004

Frank Grellert <fgrellert at> writes:

> Hi,
> does anybody have an idea how to read a particular line of a file like awk's
> awk '{if( NR==12) print $0}' filename (reads lineno 12 of filename)

for lineno, line in enumerate(open_file):
    # lineno starts at 0, though


  <radix> I feel so special when people quote me
                                                -- from Twisted.Quotes

More information about the Python-list mailing list