Summary

File handling is inevitable when dealing with measurements and other sources of a larger amount of data. Also communication with other programs and tools is done via file handling.

You learned to see a file as a Python object like others with important methods such as readlines and write. We showed how files can be protected by special attributes, which may allow only read or only write access.

The way you write to a file often influences the speed of the process. We saw how data is stored by pickling or by using the shelve method.

Get Scientific Computing with Python 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.