Should I close a file with file.close() when there is a FileNotFoundError exception?

前端 未结 0 1159
有刺的猬
有刺的猬 2021-01-21 08:50

I\'m trying to open a file in python and print a message when the file doesn\'t exist. But I\'m confused whether to close the file or not when the exception happens.



        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题