如果要编写调试器,则需要大量使用该
inspect模块:
def show_callers_locals(): """Print the local variables in the caller's frame.""" import inspect frame = inspect.currentframe() try: print(frame.f_back.f_locals) finally: del frame

如果要编写调试器,则需要大量使用该
inspect模块:
def show_callers_locals(): """Print the local variables in the caller's frame.""" import inspect frame = inspect.currentframe() try: print(frame.f_back.f_locals) finally: del frame