Python File close() Method - W3Schools
www.w3schools.com › python › ref_file_closeClose a file after it has been opened: f = open("demofile.txt", "r") print(f.read ()) f.close () Run Example » Definition and Usage The close () method closes an open file. You should always close your files, in some cases, due to buffering, changes made to a file may not show until you close the file. Syntax file .close () Parameter Values