> -----Original Message-----
> From: Chris Angelico <ros...@gmail.com>
> Sent: Sunday, May 30, 2021 5:47 PM
> To: Python <python-list@python.org>
> Subject: Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]
> 
<Snipped> 
> 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)
> 
> Then, in a separate window - or even on a completely different machine, via 
> SSH
> or equivalent - "tail -F logfile.txt" will be your console.

Thank Chris.  Your method will certainly work, I just used the python logging 
facilities to do effectively the same thing, but it is a slower debugging 
process than having the ability to examine the program environment dynamically 
while it is actually executing but stopped at a chosen breakpoint.

Using tail on a Windows system requires non-native facilities (though 
gnuwin32's tail does a creditable job).

I'm used to having the facilities of an interactive debugger available in my 
day job (not on *ix or Windows systems though), I just thought that interactive 
debugging would be more the rule than the exception here too.

Peter
--


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to