I checked the flow of methods and the order of execution in Python Tracing and tracking the execution of Python statements
I was able to output the relationship between the caller / callee
If it ’s just the relationship between function calls
python -m trace -T {Program}.py
python
python -m trace {OPTION} {PROGRAM}.py
There are various options, pick up only those that are likely to be used in the future
a | a | a |
---|---|---|
-c | --count | Create a file showing how many times each statement was executed |
-C | --coverdir | Specify the directory to save the report file |
-t | --trace | Show lines exactly as they were executed |
-l | --listfuncs | View of executed function |
-T | --trackcalls | View call relationships |
There are still other options, so if you want to check in more detail To reference page
https://docs.python.org/ja/3/library/trace.html#module-trace
Recommended Posts