CPU usage of Python interpreter doing empty while loop under XP

Peter Hansen peter at engcorp.com
Wed Apr 28 08:54:09 EDT 2004


Jon Perez wrote:

> I would be able to use pdb if Console allowed you to separate 
> the screen buffer for the program output with that of the command 
> line from which you invoked said program (where the error messages
> and pdb output should go to), but there doesn't seem to be a way 
> to do that.

There are a variety of ways to get remote debugging and
remote interpreter prompts, some supported by the standard
library modules (such as the cmd module).  I also note
in the pdb module documentation that the Pdb class itself
is explicitly extensible, suggesting you could rather
easily extend it to support external interfaces other than
the local console.  And a quick Google search suggests that
the functionality you needed was added (probably using the
time machine again) around last August:

http://mail.python.org/pipermail/patches/2003-August/013227.html

(Probably your current approach will suffice for now, but
consider this for the next time, as it will give you
significantly enhanced debugging abilities, including the
possibly useful ability to launch a debugger prompt
as soon as an exception is raised, right where the exception
is caught.)

-Peter



More information about the Python-list mailing list