Skip to main content

seek() and tell() Function in Python

 





s = open("ak1.txt")
# print(s.tell())         # it will tell us the position of line
# print(s.readline())     # It will print only one line
# print(s.readlines())    # It will print all lines

s.seek(0)     # it will start printing line from which u have given character
print(s.readline())
print(s.tell())      


s.close()





Comments