seek and tell in python

Solutions on MaxInterview for seek and tell in python by the best coders in the world

showing results for - "seek and tell in python"
Martina
19 Feb 2018
1# Python program to demonstrate
2# seek() method
3  
4# Opening "GfG.txt" text file
5f = open("GfG.txt", "r")
6  
7# Second parameter is by default 0
8# sets Reference point to twentieth 
9# index position from the beginning
10f.seek(20)
11  
12# prints current postion
13print(f.tell())
14  
15print(f.readline()) 
16f.close()