当你想要捕获一些代码片段内抛出的异常时,在编辑器中选择,然后按下 &shortcut:SurroundWith; (Code | Surround With) 并选择 try/except。这将自动生成 except 子句。