Python Basics: File System Operations
So far, you’ve written programs that get their input from one of two
sources: the user or the program itself. Program output has been limited
to displaying some text in IDLE’s interactive window.
These input and output strategies aren’t useful in several common
scenarios, such as when:
- The input values are unknown while writing the program.
- The program requires more data than a user can be expected to type in by themselves.
- Output must be shared with others after the program runs.
This is where files come in. You’ve likely been working with computer files for a long time. Even
so, there are some things that programmers need to know about files
that general users do not. Specifically, you’ll want