User Interface Suggestions? (newbie)

BartC bc at freeuk.com
Thu Oct 6 09:13:50 EDT 2016


On 06/10/2016 13:38, Peter Otten wrote:
> BartC wrote:

>> All this advice seems to be getting out of hand, with suggestions of
>> 'curses' and 'blessings' and using GUI. I've tried 'ncurses' elsewhere
>> and it was over the top for what I wanted to do.
>>
>> The OP wants to runs on Pi which I think runs Linux.
>>
>> So all they are asking is, is there a way of randomly positioning the
>> cursor within the terminal window so that the next output is at that
>> position. Something like an escape sequence. Terminal screens have been
>> around a long time, you'd think someone would have had such a
>> requirement before!
>>
>> I'd quite like to know too. However I've just tried a test sequence
>> ("<esc>[P1d" to move the cursor to row 1) and it didn't work. If there's
>> reason why something so basic won't work (hence the need for curses etc)
>> then that would be useful to know too. (And how does curses manage it?!)
>
> Perhaps you picked the wrong escape sequence? I tried <esc><line>;<column>H
> taken from <http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x361.html>, and it
> seems to work (the test system is not a Pi though):

Hey, that worked!

(Maybe I'll finally be able to port my editor and IDE to Linux after all.)

Maybe that can help the OP too. These sequences can trivially be wrapped 
with easy-to-use functions such as setpos(row,column). (Ideally there 
needs to be a way to get terminal size in rows and columns too.)

-- 
Bartc



More information about the Python-list mailing list