0

I am trying to format some text that I am trying to add to a python script. It has two sentences and I would like to have the second sentence to be in italic.

Given below is the sentence:

'Key points include' + '\n' + 'Improved performance'

I would like to have the phrase Improved performance to be in italic

Expected Output:

Key points include
Improved performance

scott martin
  • 1,253
  • 1
  • 14
  • 36
  • @AhsanulHaque I have tried that but that dint work – scott martin Mar 21 '19 at 05:25
  • The suggested answer works only if your console supports italics. If it does not, than what you want is not possible. – DYZ Mar 21 '19 at 05:26
  • https://indianpythonista.wordpress.com/2017/04/02/formatted-text-in-linux-terminal-using-python/ – Vivek Mar 21 '19 at 05:27
  • The `\e[3m` escape sequence formats text as italic in shells and terminals that support it, but some build systems (like pycharm or sublimeREPL) don't support italics – Alec Mar 21 '19 at 05:28

0 Answers0