If you want to modify the top line of a file and save it under a new file name, it is not possible to simply modify the first line without iterating over the entire file. On the bright side, as long as you are not printing to the terminal, modifying the first line of a file is VERY, VERY fast even on vasy large files.
Assuming you are working with text-based files (not binary,) this should fit your needs and perform well enough for most applications.
import os
newline = os.linesep # Defines the newline based on your OS.
source_fp = open('source-filename', 'r')
target_fp = open('target-filename', 'w')
first_row = True
for row in source_fp:
if first_row:
row = 'the first row now says this.'
first_row = False
target_fp.write(row + newline)