Outline for November 26, 2012

Reading: § 15
Due Date Changed!

Assignment Due: Friday, November 30, 2012 at 11:59 PM

  1. Files
    1. What is a file?
    2. What can you do with it? (For example, read, write, append)
    3. Types of files (text, binary)
  2. File Input and Output for text files
    1. Opening and closing: open(filename, mode), close()
    2. Reading: readline(), readlines(), read(), read(n)
    3. Writing: write(str), writelines(list)
  3. Examples
    1. Print out a named file [fileio1.py]
    2. Print out a named file and prepend line numbers [fileio2.py]
    3. Store the output in filename.lst [fileio3.py]

A PDF version is available here.
ECS 10, Basic Concepts of Computing
Fall Quarter 2012