importance of closing data "flushedto disc on closure write python script "flushfile object file system closing files is even more important for written files that read ones it is only when file is closed that the data you have written to the python file object is definitely sent to the operating system' file this is process called "flushing the file to discwriting to disc is slow by computing standards sofor efficiency reasonssystems like python tend to wait until they have at least certain amount of data for file before they flush it to disc if your program exists before flushing then the data may be lost closing file signals that there will be no more data coming for it so python flushes whatever it has in hand to the disc as part of the closure process