To read contents of a file:
data = open(filename, \"r\").read()
The open file immediately stops being referenced anywhere, so the file obje
looks fine to me.. I read files like that often.