I am using python 2.x and I am going through company code, I found code that looks like:
filename = open('text.json', 'r')
# doSomething()
filename.close()
I am used to reading a file like so:
with open('text.json', 'r') as filename
# doSomething()
Can anyone explain what the difference is?