2020年AI可能会火的方向及好用工具

tools

tenacity

  • python 重试模块:例如ftp重连
  • pip install tenacity
import random
from tenacity import retry

@retry
def do_something_unreliable():
    if random.randint(0, 10) > 1:
        raise IOError("Broken sauce, everything is hosed!!!111one")
    else:
        return "Awesome sauce!"

print(do_something_unreliable())

猜你喜欢

转载自blog.csdn.net/weixin_32393347/article/details/104281669