Is it possible to write something like this:
>>> text_output = "Hello World."
>>> print text_output
...where if the text_output is printed to the Python Shell, it is printed in italics?
In Python 2 or 3 if your console supports italics, e.g. rxvt-unicode you can precede your Italic text with the ansi escape code for italics \x1B[3m
, and then append it with \x1B[0m
for reset/normal to return to normal characters.
>>> print("Normal text \x1B[3mitalic text\x1B[0m normal text")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With