seek and tell function in python

technical talkiess
0

 f = open("text.txt")

if you want to the current file pointer so you can use the following command
print(f.tell())
the flowing command is use to get the line by line file content
print(f.readline())
if you want to reset the file pointer so then you use the seek function and pass the pointer value ... then check the tell function poiter vallue is changed

print(f.seek(3))
if you want to the current file pointer so you can use the following command
print(f.tell())

below 2 satetment print another lines in the files .... its read only the one by one line in the files
print(f.readline())

if you want to the current file pointer so you can use the following command
print(f.tell())


print(f.readline())


text.txt

vishal is the smart boy vishal education bsc it complete asd asdasd asd asdas asdd as asd

Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)