📜  python 重试 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:42.957000             🧑  作者: Mango

代码示例1
import time
def retry(fun, max_tries=10):
    for i in range(max_tries):
        try:
           time.sleep(0.3) 
           fun()
           break
        except Exception:
            continue