No need to call close on f if you are using context manager (the with keyword).