Does the code close the file after writing to it?

Please edit your post and wrap your code with code tags:


YOUR CODE HERE

to get highlighting and preserve formatting.