情况
常常在程序流程里边必须开展出现异常捕捉解决,这儿纪录下
python try except的恰当书写
f=open('h3blog.text','wb')
try:
f.write("hello,www.h3blog.com")
except Exception as e:
print(e)
finally:
f.close()
常常在程序流程里边必须开展出现异常捕捉解决,这儿纪录下
f=open('h3blog.text','wb')
try:
f.write("hello,www.h3blog.com")
except Exception as e:
print(e)
finally:
f.close()