fileinput.isfirstline()

fileinput.isfirstline()[source]

Returns true the line just read is the first line of its file, otherwise returns false.