Wrap opening the file in a with statement.