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 told to use this syntax instead a couple of times now..
with open("sub_ranks.txt", "r+") as f:
for line in f:
...
Is a file object "close" statement still needed in the second example, when the "with" statement is being used?
And if so, is there any concrete reason to use the "with" statement for file reading? In this case, it's (slightly) more verbose.