any application that saves data goes through some sort of output loop in this casethe loop simply prints the data onscreen howeverin the upcoming sectionsyou actually output the data to file choose runrun module you see the output shown in figure - this is representation of how the data would appear in the file in this caseeach record is separated by carriage return and linefeed control character combination that isgeorgesallyand doug are all separate records in the file each field (data elementis separated by comma text fields appear in quotes so that they aren' confused with other data types figure - the example presents how the data might look in csv format creating file any data that the user creates and wants to work with for more than one session must be put on some sort of permanent media creating file and then placing the data into it is an essential part of working with python you can use the following steps to create code that will write data to the hard drive this example also appears with the downloadable source code as formatteddata py and createcsv py open the previously saved formatteddata py file you see the code originally created in the "creating content for permanent storagesectionearlier in this appear onscreen this example makes modifications to the original code so that the class can now save file to disk add the following import statement to the top of the fileimport csv the csv module contains everything needed to work with csv files