class CarRecord: # declaring a class without other methods def init (self): # constructor self .VehicleID = \"\" self.Registr
you need to catch EOFError in your loop…
EOFError
You can't read forever from a file that does not contain infinite data, so you need to put a way for the loop to stop.
Also, there is absolutely no need to have those loops, you can directly store the list, and it will just load the list.