Trouble using sys.settrace



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()

.



Relevant Pages