By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,462 Members | 799 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,462 IT Pros & Developers. It's quick & easy.

How do you code to underline - 'a simple line of text' for example, or a floating poi

P: 2
Nothing complicated. I have spent hours researching Python 3.6 Manual, Tutorial, several books and have not found an inkling of how to write code to print a line of text underlined. E.g. "Title of this section", or the sum '10.23'. I am amazed that such an elementary and important aspect does not seem to be covered.

Please help.
Sep 8 '16 #1
Share this Question
Share on Google+
3 Replies


Expert 100+
P: 619
That depends on the software used to render the text. A word processor has a different method/software/code to underline compared to text displayed on a terminal, than a pdf file does, etc.
Sep 18 '16 #2

P: 2
in a python program, which involves outputting text to a screen, whether it be a smart phone, tablet or computer screen, how do you code to under line such text as Tiles, sub titles, numbers etc.?
Sep 15 '17 #3

Rabbit
Expert Mod 10K+
P: 12,365
It's not as simple as you think. It's not Python that renders the text so it has no control over how the output looks to the user. That's up to the shell that's formatting the output.

In Linux and Unix shells, there are some control characters that might be supported by that particular flavor of *nix that will allow you some limited formatting options.

In the default Windows shell, no such option exists.

So you're looking at the wrong documentation to find what you want. What you need is to look up the documentation on whatever OS you're running Python on to see what formatting options they offer and what you need to send to the shell.
Sep 19 '17 #4

Post your reply

Sign in to post your reply or Sign up for a free account.