0.1.165
This commit is contained in:
@@ -86,6 +86,13 @@ def run(function_name, *args, **kwargs):
|
||||
pass
|
||||
return return_data
|
||||
|
||||
# 使用该函数实现 try except 结构
|
||||
def try_except(function_name, *args, **kwargs):
|
||||
try:
|
||||
return function_name(*args, **kwargs)
|
||||
except:
|
||||
pass
|
||||
|
||||
# 获取运行的日期和时间并写入文件
|
||||
def statistics_with_day_and_time(content='', filename='time_logging', file_format='.txt'):
|
||||
import datetime
|
||||
|
@@ -58,6 +58,15 @@ def timer_decorator_with_parameters(unit='second', print_show=1, write_file=0, f
|
||||
return wrapper
|
||||
return timer_decorator
|
||||
|
||||
# 函数的装饰器,用于实现 try except 结构
|
||||
def try_decorator(func):
|
||||
def wrapper(*args, **kwargs):
|
||||
try:
|
||||
return func(*args, **kwargs)
|
||||
except:
|
||||
pass
|
||||
return wrapper
|
||||
|
||||
# # 函数的装饰器,用于GUAN软件包函数的使用统计
|
||||
# def statistics_decorator(func):
|
||||
# def wrapper(*args, **kwargs):
|
||||
|
Reference in New Issue
Block a user