What cool hacks can be done using sys.settrace?

前端 未结 7 1634
無奈伤痛
無奈伤痛 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:33

    One latest project that uses settrace heavily is PySnooper

    It helps new programmers to trace/log/monitor their program output. Cheers!

提交回复
热议问题