Assume I have access to the following Python module (foo.py) that was written by someone else (let's call her Ann):
import libX libX.doSomething() for i in range(10): a = i + 3 b = foo()
I am the creator of
libX, which Ann uses in her code.
What I am trying to do is to automatically track some variables (and their values) inside Ann's code during execution. For example, I want my
doSomehting() function to be able to track the values of the variables
b and send them to some visualization tool -during the execution of
doSomehting() function can already locate and identify the variables that I am interested in using Python AST (Abstract Syntax Tree).
Ann's code and my library are both written in Python.
What tool's or techniques do you recommend to accomplish this task?