3 from e32 import ao_sleep
4 refresh=lambda:ao_sleep(0)
7 def __init__(self,f_all=u'c:\\traceit.txt',f_main=u'c:\\traceitmain.txt'):
8 self.out_all=open(f_all,'w')
9 self.out_main=open(f_main,'w')
12 sys.settrace(self.traceit)
19 def traceit(self,frame, event, arg):
20 lineno = frame.f_lineno
21 name = frame.f_globals["__name__"]
22 file_trace=frame.f_globals["__file__"]
23 line=linecache.getline(file_trace,lineno)
25 self.out_all.write("%s*%s*of %s(%s)\n*%s*\n" %(event,lineno,name,file_trace,line.rstrip()))