outFile.close
You didn't call the method!
In the future, note that the preferred way of opening files is
with open(name, mode) as f:
do_whatever(f)
This handles closing the file at the end of the with
block, no matter how control leaves it.