Python Arena

Module 23

Reading files

Reading text files. Opening a file with open and with, reading it whole or line by line, cleaning up lines with strip, splitting lines of values with split, and combining the data of several files.

Steps

  1. Opening and reading a file
  2. Going through a file line by line
  3. Lines with several values
  4. Read the file once, use the data many times
  5. Combining data from several files