小编Nik*_*o P的帖子

执行(部分)尝试块后除块

我知道这是一个奇怪的问题,可能没有答案.在捕获异常并执行except块之后,我正在尝试执行try块的其余部分.

例:

[...]
try:
 do.this()
 do.that()
 [...]
except:
 foo.bar()
[...]
Run Code Online (Sandbox Code Playgroud)

do.this()提出由管理的异常foo.bar(),然后我想执行代码do.that().我知道没有GOTO声明,但也许某种黑客或解决方法!

谢谢!

python exception-handling

2
推荐指数
1
解决办法
2677
查看次数

标签 统计

exception-handling ×1

python ×1