bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using ncurses only for terminfo (no I/O)


From: Grant Edwards
Subject: Re: Using ncurses only for terminfo (no I/O)
Date: Sat, 16 Jan 2021 02:10:05 -0000 (UTC)
User-agent: slrn/1.0.3 (Linux)

On 2021-01-16, Timothy Allen <thristian@gmail.com> wrote:
> On 16/1/21 10:22, Grant Edwards wrote:
>>      bold = curses.tigetstr('bold').decode('ascii')
>
> Not strictly relevant to your tputs/tparm conundrum, just a suggestion. 
> You can avoid all that messing with decode('ascii') if you write to the 
> inner byte I/O handle instead of the Unicode I/O wrapper:
>
>     write = sys.stdout.buffer.write

Yea, I know -- but being able to insert escape sequences in formatted
strings and not having to keep track of whether you're writing strings
or bytes makes application code everything far easier to
read/maintain.

--
Grant







reply via email to

[Prev in Thread] Current Thread [Next in Thread]