我有一段代码:
features_dict = json.load(open(features_path))我想知道我的文件在执行后是保持打开还是自动关闭?
发布于 2020-05-12 21:19:30
该文件保持打开状态,您需要关闭它或使用with open,它将在超出范围后自动关闭:
with open ('features_path','r') as features_path:
#Do stuffhttps://stackoverflow.com/questions/61752712
复制相似问题