with open("E:\Antariksa\LINES.TXT",'r') as ft:
try:
while True: s=ft.readline() st=s.split() if len(st)\>=10: print(s+"\\n")except EOFError:
print("End of the file. Thank you!!")except:
print("Some exception occured")
I wrote this code on Jupyter notebook. It showed the desired output only once. When I tried running the same code in the same cell for the second, third and consequent times, it didn't show the desired output i.e. the code ran but the output wasn't visible. I tried closing the file and running to he code again. This time too it was the same. Then I closed my entire notebook including the Home page. After that when I reopened the notebook and that particular file where this code was, and ran it again, this time it showed the desired output. But just as before the output wasn't visible in the subsequent times. I have to close the notebook again and again to see the output for this code. I tried to use the tell and seek function(although they are specifically meant for binary files and not for text files) and the ftell function to find out the position of the pointer. Still the result was the same, "no output" yet no error in code.
What exactly am I missing here ?