For opening files, I\'m used to the apparently older syntax:
f = open(\"sub_ranks.txt\",\"r+\") for line in f: ... f.close()
I\'ve been tol
No.
Say you want to print the hostname like so:
with open("/etc/hostname","r") as f: print f.read()
It will open the file, do its job then close the file.