FUNCS_AND_ARGS dla pętli Python
funcs_and_args = [(func1, "150mm"),
(func1, "100mm",
(func2, "50mm"),
(func3, "50mm"),]
for func, arg in funcs_and_args :
try:
func(arg)
# exit the loop on success
break
except ExplicitException:
# repeat the loop on failure
continue
else:
# List exhausted without break, so there must have always been an Error
raise Exception("Error text")
Micah M