Do any debuggers work with Python threads?

Tom nospam at nospam.com
Thu Oct 26 14:07:10 EDT 2000


Here's a little Trace utility that I use for debugging multi-threaded python
apps.
I've only used it on Win32 - you'll need to compile it yourself.

To use it I put the following code at the beginning of a Python
application's main module:

from Trace import *;
TraceOn( 'x:\\logs\\ServerTrace.txt' );        // specify no parameter for
stdout.
Time = time.localtime( time.time() );
Trace( 'MyApp.py, ' + time.strftime( "%a at %I:%M%p.", Time ) );

It indents comments according to the current stack depth (this make sense to
me).

If you would like, I could change it so that each Python thread (each
tstate) gets to specify its own output file.

Tom.

> <jeffg at provenance.com.au> wrote in message
> news:mailman.972341522.15869.python-list at python.org...
> > Is there any way I can use any of the Python debuggers with Python
> > applications that are multi-threaded using the 'threading' module?
> >
> > I'm talking about a pure Python app at the moment. I don't need to
> > worry about debugging external C modules.
> >
> > I've tried IDLE, Wing & pdb to no avail. The developers of Wing say
> > they plan to implement it in the next major version, but that's months
> > away.
> >
> > I'm mainly working under Linux, but do occasional work in Windows.
> >
> > Other than putting print statements everywhere, do I have any other
> > option?
> >
> >
>
>





More information about the Python-list mailing list