Debugging on windows via print statements -- reliable?

Nick Arnett narnett at mccmedia.com
Sun Mar 24 22:43:36 EST 2002


As I try to track down why my code is getting stuck (in a situation where it
could take ages to step through in the debugger), I'm using print statements
so that I can see where it's just been before it freezes.  Trouble is, I'm
not seeing much consistency in when (how many iterations) or where (in the
code) it stops responding.

Now I'm wondering if way of creating signposts is reliable.  Is it possible
that it's actually hanging up somewhere without actually outputting some of
my print statements, even though they've been processed?  Sometimes, I'm
only getting part of the output of a print statement, which seems truly
weird.  If I had multiple threads, perhaps I could be clobbering the thread
that's printing my signposts, but I'm not...

Is there something on Windows (Win2K, to be exact) that I need to do to make
sure that print statements are actually output as soon as the statement is
executed.

Thanks in advance...

Nick

--
narnett at mccmedia.com
(408) 904-7198





More information about the Python-list mailing list