Print to end of line in a terminal

N

ndlarsen

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
 
B

Bjoern Schliessmann

ndlarsen said:
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.

Well, just print ${COLUMNS} characters. If you rephrased your
problem with more detail one could give better suggestions.

Regards,


Björn
 
J

John J. Lee

ndlarsen said:
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
 
N

ndlarsen

Hello again.

I apologize for not replying earlier but I have been swamped in work
lately. I appreciate your replies. Eventually I chose using curses for
"right-hand edge of the window" as it seemed to be the most suitable
solution.

Thank you.

ndlarsen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top