Now, we are ready to read from the file object. Every file object has several open, read, write, and close methods that can be called. The most common ones are discussed in my tutorials on file handling. For our purposes, we will read the file into a dictionary.
Before starting the iteration, we read one line into a variable line and initiate an empty dictionary. Let's call it record.
line = datafile.readline()
record = {}
If you need more help with dictionaries, you can get a quick tutorial or review in my beginner's tutorial.
