Dealing with Files
Rob Mastrodomenico · 2022
This chapter covers some important concepts relating to files and how to read from and write to them using Python. It considers how to append to a file. A more common type of file that the readers might want to open in Python is a spreadsheet like file containing sheets of data. This could be in the form of an xls or xlsx file. For a Python user, JavaScript Object Notation (JSON) will appear to be a mixture of lists and dictionaries in that the readers can have collections of key value pairs like in a dictionary but also have data stored in a manner like a list. Unlike JSON, Extensible Markup Language does not have a natural link to Python data types and so needs a bit more of an introduction into its types and how it works.