Printing to console (No Scroll)

Valentino Volonghi aka Dialtone dialtone#NOSPAM#.despammed at aruba.it
Fri Jan 16 20:25:39 CET 2004


"Totte Karlsson" <mtk at qm.com> writes:

> Any alternatives to ncurses? It seems like a overkill for this...
import sys, time
nrchars = 0

for i in xrange(10):
    sys.stdout.write("\b \b"*nrchars)
    sys.stdout.flush()
    Str = "%i seconds to go" % (10-i)
    nrchars = len(Str)
    sys.stdout.write(Str)    
    sys.stdout.flush()
    time.sleep(1)
print
    

-- 
Valentino Volonghi, Regia SpA, Milan
Linux User #310274, Gentoo Proud User



More information about the Python-list mailing list