../_images/book_cover.jpg

This notebook contains an excerpt from the Python Programming and Numerical Methods - A Guide for Engineers and Scientists, the content is also available at Berkeley Python Numerical Methods.

The copyright of the book belongs to Elsevier. We also have this interactive book online for a better learning experience. The code is released under the MIT license. If you find this content useful, please consider supporting the work on Elsevier or Amazon!

< 10.6 Summary and Problems | Contents | 11.1 TXT Files >

Chapter 11. Reading and Writing Data


Motivation

Storing data and the results of your programming efforts is important for working over multiple sessions and sharing your results with collaborators. Since when Python closes, all the variables in the memory are lost, data must be stored in some other way. Sometimes data must also be readable by or written in a form that can be read by other programs.

This chapter shows you how you can use Python to read and write data in several common formats.