Reading records from a CSV file
As a first approach to loading read-only data into our application, we will use acomma-separated values (CSV) file. This format tabulates data in plain text files, where each file corresponds to the fields of a record, separated by commas, like so:
Gauford,Albertine,[email protected],(614) 7171720 Greger,Bryce,[email protected],(616) 3543513 Wetherald,Rickey,[email protected],(379) 3652495
This solution is easy to implement for simple scenarios, especially if the text fields do not contain line breaks. We will use the csv
module from the standard library, and once the records are loaded into our application, we will populate the widgets developed in the previous recipes.
Getting ready
We will assemble the custom widgets we created in the previous recipe. Once the records are loaded from the CSV file, our application will look as shown in the following screenshot:

How to do it...
Apart from importing the Contact
class, we will also import the ContactForm
and...