Skip to content

Python

Text files

Read and write text files with explicit encoding and reliable cleanup.

With Zoonk, your plan starts at this chapter and fits your schedule.

Build my plan

Start free, no account needed.

Where this chapter sits in the course

Lessons

Chapter 19 of 22 · 5 short lessons · 19 min
  1. 1Reading text files4 min
  2. 2Line-by-line file processing3 min
  3. 3Writing and appending text3 min
  4. 4Text file errors and encodings3 min
  5. 5Challenge: Text files6 min

What you'll learn

  • Read and write text using context managers
  • Choose file modes and handle encoding failures

Your plan from this chapter

It follows the course from here, at your pace, with reviews before you forget.

Build my plan

Start free, no account needed.