def f(format_string):
caller_frame = inspect.currentframe().f_back
caller_globals = caller_frame.f_globals
caller_locals = caller_frame.f_locals
lf = LiteralFormatter()
return lf.format(format_string, caller_globals, caller_locals)
评论列表
文章目录