Why can i read lines from file only one time?

There’s only one line in that file, and you just read it. readlines returns a list of all the lines. If you want to re-read the file, you have to do file.seek(0)

Leave a Comment