Term
|
Definition
gets input from a file rather than from a user typing on a keyboard. |
|
|
Term
|
Definition
closes the file, after which no more reads or writes to the file are allowed. |
|
|
Term
|
Definition
returns the file contents as a string. |
|
|
Term
|
Definition
returns a list of strings, where the first element is the contents of the first line, the second element is the contents of the second line, and so on. |
|
|
Term
|
Definition
writes a string argument to a file. |
|
|
Term
|
Definition
indicates how a file is opened. open('myfile.txt', 'w') opens myfile.txt for writing. If mode is not specified the default is 'r'. types are 'r', 'w', 'a', and 'mode+'. |
|
|
Term
|
Definition
data is written to disk only when a newline character is output. f = open('myfile.txt', 'w', buffering=100) will write the output buffer to disk every 100 bytes. |
|
|
Term
|
Definition
can be called to force the interpreter to flush the output buffer to disk. |
|
|
Term
|
Definition
considered when reading and writing files outside the executing program's directory, since file path representations often differ between operating systems. |
|
|
Term
|
Definition
contains many portable functions for handling file paths. |
|
|
Term
|
Definition
The character between directories, e.g. "\\"or "/" |
|
|