TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: T M SMITH
from: BIG BAD BOB
date: 2017-10-23 00:09:00
subject: Re: Screen control

On 10/22/17 06:34, T M Smith wrote:
>> I've implemented a version of Curses for Java, using the information and
>> API description in "Programming with Curses" (O'Reilly) partly because I
>> could and partly to convince myself that I understood Curses well enough
>> to do it.
>   I am altering a python program and just wish to display readings of
> temperature etc. in the same place on screen after each update.
>

I posted a sample C program.  here's a sample python program using the
ANSI sequence to "home the cursor":


import time
import sys

for xx in range(0,500) :
     print "here I am  ", xx, "\x1b[1G",
     sys.stdout.flush()
     time.sleep(0.1)


(note ',' at end of print, which doesn't do a line feed - also need the
'flush' to make sure it outputs immediately)

enjoy

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.