Outline for November 26, 2012
Reading: § 15
Due Date Changed!
Assignment Due: Friday, November 30, 2012 at 11:59 PM
- Files
- What is a file?
- What can you do with it? (For example, read, write, append)
- Types of files (text, binary)
- File Input and Output for text files
- Opening and closing: open(filename, mode), close()
- Reading: readline(), readlines(), read(), read(n)
- Writing: write(str), writelines(list)
- Examples
- Print out a named file [fileio1.py]
- Print out a named file and prepend line numbers [fileio2.py]
- Store the output in filename.lst [fileio3.py]
A PDF version is available here.
|
ECS 10, Basic Concepts of Computing
Fall Quarter 2012
|