close ends access to an open file and releases its file resources. Call it after finishing with the file; once closed, the file cannot be used again. section 5.1.4
Close a file after processing it
nfl_file = open('nfl_offensive_stats.csv') for line in nfl_file: process(line) nfl_file.close() The loop reads one line at a time. close then ends access to the file, completing the read-process-close sequence. section 5.1.4
>>> nfl_file.close()
See the direct close call used after reading the statistics file. section 5.1.4



