Printing to console (No Scroll)

Totte Karlsson mtk at qm.com
Thu Jan 15 03:42:43 CET 2004


Great, thanks for all help! I'll try these things

"Derek" <none at none.com> wrote in message
news:bu45kp$d99m3$1 at ID-46268.news.uni-berlin.de...
> "Diez B. Roggisch" wrote
> > > Any alternatives to ncurses? It seems like a overkill for this...
> >
> > Maybe you can use sys.stdout.write in conjunction with control-
> > codes for moving back the cursor to column one. But you'll have
> > to lookup these for yourself :)
>
> I think \r is the control code (at least if you want to go back to the
> start of the line):
>
> import time, sys
> for second in range(10):
>      time.sleep(1)
>      sys.stdout.write(`10-second` + " seconds \r")
>      sys.stdout.flush()
>
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>







More information about the Python-list mailing list