Python has a built-in API for tracing: https://docs.python.org/3/library/sys.html#sys.settrace Here's an example of how to use it (obviously a minimal case, you can customise your handler do do whatever you need): def mytrace(frame, event, arg): if event == "call": print("call", frame.f_code.co_name, frame.f_locals) elif event == "return": print("return", frame.f_code.co_name, arg) return mytrace import sys sys.settr…
I confess I'm surprised the builtin wasn't one of the demoed options. Curious what the reason is.
Re: Tracing Python
#11I just pushed an addendum, and it is being rendered right now.