used "with open" instead ofr the normal open so it closes the file automatically
Merge pull request #1 from Itxaka/master

small pull