No need to file.close when using 'with open'