Print to end of line in a terminal

John J. Lee jjl at pobox.com
Wed Feb 27 19:44:03 EST 2008


ndlarsen <usenet at ionline.dk> writes:

> Hey.
>
> This might seem as a arbitrary question to some. Anyway, I'm wondering
> how I go about printing text to the end of a line in a
> terminal/console. I've been googling it for a few days without any
> success. Any suggestions will be greatly appreciated.
>
> Regards ndlarsen

Assuming by "end of a line" you mean "right-hand edge of the window",
there's an example here:

http://codespeak.net/svn/user/jjlee/rudolf/trunk/colorwatch.py


Another alternative would be to use curses.


John



More information about the Python-list mailing list