Please enable JavaScript to use CodeHS

Texas Computer Science I in Python

File I/O

Students learn to read, write, and process information from text files.

Lessons

12.1 What is File I/O

  • What is File I/O
  • What is File I/O
  • What is a TXT File?
  • What is a CSV File?
  • Choosing a File Format: TXT vs. CSV
  • +3 more

12.2 Reading Character from File

  • Reading Character from File
  • Reading Characters from File: Example Walkthrough
  • Reading Characters from File
  • Read Specific Characters
  • Read All Characters
  • +3 more

12.3 Reading Line from File

  • Reading Line From File
  • Reading Line from File: Example Walkthrough
  • Read Line from File
  • Reading and Printing Lines
  • Counting Lines in a File
  • +2 more

12.4 Reading All Lines from File

  • Reading All Lines from File
  • Reading All Lines from File: Example Walkthrough
  • Reading All Lines from File
  • Using readlines()
  • Finding the Needle in the Haystack
  • +1 more

12.5 Writing to File

  • Writing to File
  • Write to End of File: Example Walkthrough
  • Writing to File
  • Write to File
  • Append to File
  • +3 more

12.6 Move File Pointer Position

  • Move File Pointer Position
  • Move File Pointer Position: Example Walkthrough
  • Move File Pointer Position
  • Using tell()
  • Reading from a Position in File
  • +2 more

12.7 File I/O Quiz

  • File I/O Quiz

Courses that include this module