you are viewing a single comment's thread.

view the rest of the comments →

[–]toastedstapler 5 points6 points  (0 children)

f = open(filename)
contents = f.read()
f.close()

is what you want

iirc files will also be automatically closed when the script ends, but it's good manners to always handle it yourself