Reading a Single Line from a File : Getline : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Getline »

 

Reading a Single Line from a File


import linecache
filePath = "input.txt"

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



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Getline