除了最后在python中阻塞之外,是否可以进行空尝试,类似这样,
try:
#nothing here,
except:
#nothing here as well,
finally:
#nothing here too.
答案 0 :(得分:1)
当然,您可以使用try:
pass
except:
pass
finally:
pass
传递一个块:
def a():
pass
while True:
pass
for i in range(10):
pass
...
更多例子:
Format