W WolfCode · CSC 141
Chapter 07

File I/O

文件输入输出

Persistence. open() / with / read / write / append. The shape of every batch data job: read, process, write. Strictly aligned with Automate the Boring Stuff with Python chapter 9.

Strict source: Automate the Boring Stuff with Python ch.9

Note: Browser playgrounds can't open real files (sandbox). Run lessons in WolfCode locally to test file I/O end-to-end.

Lessons in this chapter

  1. 07.00 Worked Example
    Walkthrough: Write Then Read
    例题: 写入再读取
    python-file-io
    8 min
  2. 07.01 Exercise
    Read CSV-Lite
    读 CSV 文件
    python-file-io python-strings python-lists
    20 min
  3. 07.02 Exercise
    Append a Log
    追加日志
    python-file-io
    20 min
  4. 07.03 Exercise
    Count Lines
    数行
    python-file-io python-loops
    15 min
  5. 07.04 Homework
    Homework: Word-Frequency Report
    作业: 词频报告
    python-file-io python-strings python-lists
    45 min