file.close() explicitely closes a file formerly opened with file. Note that the file will be closed implicitely as soon as the last reference to the file object is dropped.