Trouble using sys.settrace

tleeuwenburg at gmail.com tleeuwenburg at gmail.com
Thu Aug 30 15:31:29 EDT 2007


The code below produces no output. I would expect to see:

tracing...
tracing...
tracing...
tracing...
tracing...


I was wondering if anyone had any experience with this.

=================================
import sys

def mytrace(frame, event, arg):
    print "tracing..."

sys.settrace(mytrace)

def foo():
    for i in range(5):
        print i

foo()




More information about the Python-list mailing list