import sys
def a():
print 'aaa'
def profiler(frame, event, arg):
print event, frame.f_code.co_name, frame.f_lineno, "->", arg
# profiler is activated on the next call, return, or exception
sys.setprofile(profiler)
a()
call a 5 -> None#what is it
aaa
return a 6 -> None#what is it
return <module> 12 -> None#what is it
爲什麼打印此。
真正的問題是,你期望它打印什麼? – 2010-01-11 00:57:23