What cool hacks can be done using sys.settrace?

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

    I don't have an exhaustively comprehensive answer but one thing I did with it, with the help of another user on SO, was create a program that generates the trace tables of other Python programs.

提交回复
热议问题