Reputation: 15258
I have this piece of code :
features_dict = json.load(open(features_path))
I want to know if my file stays open after the execution or if it closes automatically ?
Upvotes: 1
Views: 69
Reputation:
The file stays open and you need to close it or use with open
and it will close automatically after going out of scope:
with open ('features_path','r') as features_path:
#Do stuff
Upvotes: 2