Answers for "seek and tell in python"

0

seek and tell in python

# Python program to demonstrate
# seek() method
  
# Opening "GfG.txt" text file
f = open("GfG.txt", "r")
  
# Second parameter is by default 0
# sets Reference point to twentieth 
# index position from the beginning
f.seek(20)
  
# prints current postion
print(f.tell())
  
print(f.readline()) 
f.close()
Posted by: Guest on May-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language