with(上下文的用法)以及其他知識點

一、上下文 class Sxw(object): def __enter__(self): '''進入''' print("你好啊") def __exit__(self, exc_type, exc_val, exc_tb): '''退出''' print("hao") obj = Sxw() with obj:
相關文章
相關標籤/搜索