Skip to Content
Head First Python
book

Head First Python

by Paul Barry
November 2010
Beginner
494 pages
10h 52m
English
O'Reilly Media, Inc.
Content preview from Head First Python

Chapter 4. Persistence: Saving data to files

image with no caption

It is truly great to be able to process your file-based data. But what happens to your data when you’re done? Of course, it’s best to save your data to a disk file, which allows you to use it again at some later date and time. Taking your memory-based data and storing it to disk is what persistence is all about. Python supports all the usual tools for writing to files and also provides some cool facilities for efficiently storing Python data. So...flip the page and let’s get started learning them.

Programs produce data

It’s a rare program that reads data from a disk file, processes the data, and then throws away the processed data. Typically, programs save the data they process, display their output on screen, or transfer data over a network.

image with no caption

Before you learn what’s involved in writing data to disk, let’s process the data from the previous chapter to work out who said what to whom.

When that’s done, you’ll have something worth saving.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Head First Python, 2nd Edition

Head First Python, 2nd Edition

Paul Barry
Dead Simple Python

Dead Simple Python

Jason C. McDonald

Publisher Resources

ISBN: 9781449397524Supplemental ContentErrata