Exploring terminfo

Grant Edwards grant.b.edwards at gmail.com
Tue Jan 19 10:15:31 EST 2021


On 2021-01-19, Alan Gauld via Python-list <python-list at python.org> wrote:
> On 18/01/2021 22:14, Random832 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 ..
>> B) expose a version of putp that uses pthon's stdout[.buffer].write
>> rather than C's putchar.
>
> To be fair that's a limitation of the C curses library. putp() is a
> wrapper around tputs() even there, and you can't change what it does.
> The gap in the curses module is that it doesn't offer the tputs()
> option as an alternative.

If the curses module provided a tputs binding, then the user could
write a useful putp(), or better yet a function that just does the
padding and returns a new bytestring.

> I've been using curses (C and python) for nearly 30 years and
> this is the first time I've ever used the tiXXX functions,  and it
> was mainly just out of curiosity rather than real need.

Same here.

--
Grant






More information about the Python-list mailing list