def REPL():
# collect all variables outside this scope
local = {}
# set stack context to 0 to avoid the slow loading of source file
for sinfo in inspect.stack(0):
local.update(sinfo[0].f_globals)
local.update(sinfo[0].f_locals)
code.interact(local=local)
评论列表
文章目录