Exploring terminfo
Grant Edwards
grant.b.edwards at gmail.com
Mon Jan 18 18:00:59 EST 2021
On 2021-01-18, Random832 <random832 at fastmail.com> wrote:
> On Fri, Jan 15, 2021, at 13:36, Alan Gauld via Python-list wrote:
>> That could make a big difference, the putp() function specifically
>> states that it writes to stdout.
>
> I think there is a reasonable argument that this is a deficiency of
> the curses module.
>
> I think that the curses module should A) expose a version of tputs
> that accepts a python callback to process each output byte B) expose
> a version of putp that uses python's stdout[.buffer].write rather
> than C's putchar.
Agreed.
I tried to use ctypes to call tputs with a Python callback that wrote
to sys.stdout, but was unable to get it to work.
FWIW, I've written up notes on the problem and provided demos of
various solutions:
https://github.com/GrantEdwards/Python-curses-and-terminfo
More information about the Python-list
mailing list