Reading a Single Line from a File : getline « File « Python Tutorial






import linecache
filePath = "input.txt"

print linecache.getline(filePath, 1)
print linecache.getline(filePath, 3)
linecache.clearcache()








12.6.getline
12.6.1.Reading a Single Line from a File