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.

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top