Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Italics
#3
Hi thanks for the reply. I tried to run the code.

txt = '\x1B[3m This is italic text \x1B[23m'
print(txt)
I am using Sublime a text editor. I saved the file as .py. When I run the code and it prints in Sublime the text editor output says,
Output:
<0x1b>3m This is italic text <0x1b> [23
I also tried to open the .py file in the Python 3.8.3 shell and the output wasn't italic text.
Output:
This is italic text 
One last question about dealing with string data type. When I make a variable and assign the text to the variable the text has to be in quotation marks. The book I am reading appears to recommend double quotes. Do you think that is right? Why are you using a single quote?

thanks,
Reply


Messages In This Thread
Italics - by Dasiey12 - May-31-2020, 07:53 PM
RE: Italics - by menator01 - May-31-2020, 08:51 PM
RE: Italics - by Dasiey12 - Jun-01-2020, 02:09 AM
RE: Italics - by menator01 - Jun-01-2020, 03:42 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020