tongjie 最近的时间轴更新
tongjie

tongjie

V2EX 第 185368 号会员,加入于 2016-08-04 11:32:03 +08:00
tongjie 最近回复了
2016 年 8 月 8 日
回复了 SlipStupig 创建的主题 Python 想请教一下 python 装饰器的作用
def safe_run(_logger):
def _run_once(func):
def f(*args,**kwargs):
try:
return func(*args,**kwargs)
except:
_logger.error(traceback.format_exc())
return f
return _run_once

在要执行的方法前面加上这个装饰器,放心多了;
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   5539 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 124ms · UTC 07:02 · PVG 15:02 · LAX 00:02 · JFK 03:02
♥ Do have faith in what you're doing.