O'Reilly logo

Python Without Fear, First Edition by Brian Overland

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11. File Ops

In programming, there’s no getting away from disk files—or rather just “files,” because these days files are not necessarily restricted to disk files. In any case, they’re essential, because they store data that doesn’t go away after the program ends. Everything from credit databases to police records depend on file storage.

Python facilities for reading and writing to files are especially easy. Some take advantage of the Python concept of iterable, which makes everything easier once you understand it.

In this chapter, I’ll introduce simple techniques for reading and writing text files.

Image Text vs. binary files

The op system (os) module ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required