If you want to get to know the Python byte codes that are executed at run time then use.
sys.settrace
have a look at the dis
module. This can tell you which byte code is in which line.
Question
I want to know if there is an easy way to get the number of python bytecodes which are executed at runtime. I know I can modify the source code of the interpreter and get what I want, but it is better that there are some standard APIs or other easy ways.
Solution
If you want to get to know the Python byte codes that are executed at run time then use.
sys.settrace
have a look at the dis
module. This can tell you which byte code is in which line.