Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top