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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top