Tracing the execution of scripts?

fumanchu fumanchu at amor.org
Fri Oct 27 18:13:09 CEST 2006


Stephan Kuhagen wrote:
> "Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> wrote:
>
> > Basically, is there something that will log every line of Python code
> > executed, in its order of execution, to a text file so that I can see
> > what is (or isn't) happening that I am expecting?
>
> Python itself can do this for you. A __VERY__ simple approach:
> ...
> Additionally, if it should work with threads, you must take care
> that every thread gets its own output file.

Or be differentiated *somehow*. My pyconquer module tabs each thread's
activity into swimlanes, so you can even see when each thread starts,
obtains/releases the GIL, and stops. See the longer example here:
http://projects.amor.org/misc/wiki/PyConquer


Robert Brewer
System Architect
Amor Ministries
fumanchu at amor.org




More information about the Python-list mailing list