What cool hacks can be done using sys.settrace?

前端 未结 7 1664
無奈伤痛
無奈伤痛 2020-12-13 02:51

I love being able to modify the arguments the get sent to a function, using settrace, like :

import sys

def trace_func(frame,event,arg):
    va         


        
7条回答
  •  情深已故
    2020-12-13 03:38

    For example, get the memory consumption of Python code line-by-line: http://pypi.python.org/pypi/memory_profiler

提交回复
热议问题