On 31May2021 07:46, Chris Angelico <ros...@gmail.com> wrote: >On Mon, May 31, 2021 at 7:03 AM Alan Gauld via Python-list ><python-list@python.org> wrote: >> You are not alone. debugging curses is one of the biggest obstacles >> to its use. [...] > >Never had this problem with curses per se (partly because I've used it >very little), but a more general technique for debugging things that >don't have a "normal" console is to create one via a pipe or file. The >easiest way is something like: > >log = open("logfile.txt", "w") >print(f"At this point, {foo=}", file=log, flush=True) [...]
Also untried, but should work: Open another terminal, note its terminal device with the "tty" command. Start your programme like this: python ...... 2>/dev/tty-of-the-other-termina Send debug statements to sys.stderr. They should show in the other window. I'd also think one could do some kind of shuffle setting up curses to attach its display to another terminal, letting you use an interactive debugging in the invoking terminal. Haven't tried this yet. Cheers, Cameron Simpson <c...@cskk.id.au> -- https://mail.python.org/mailman/listinfo/python-list