How to debug python + curses? [was: RE: Applying winpdb_reborn]

Grant Edwards grant.b.edwards at gmail.com
Mon May 31 11:16:50 EDT 2021


On 2021-05-30, Alan Gauld via Python-list <python-list at python.org> wrote:
> On 30/05/2021 18:26, pjfarley3 at earthlink.net wrote:
>> I tried winpdb-reborn some time last year on my Win10 system (python 3.8.3
>> at that time), but could not figure out how to use it to debug a python
>> script that uses the curses module.
>
> You are not alone. debugging curses is one of the biggest obstacles to
> its use.

Can't you just run the debugger in a different window and attach to
the process you want to debug? That's how one uses a debugger with
curses apps written in C/C++. Or I add debugging printf calls which
write to stderr and redirect stderr to a file.

> My approach is to define a status line at the bottom of my program and
> write print statements into that window. Something like:

Why not just use the standard python logging facility and log to a
file or another terminal window?

--
Grant



More information about the Python-list mailing list