0
mm_add_all_parser.add_argument('run_folder', help='The folder that houses the assets and events folders. The folder structure and file names must be specific. The run_folder \e[4mshould\e[0m be titled with the format')

In the above argparse statement, I want the word "should" to be in italics. But the console escape characters I'm trying in this statement seem to be ignored by argparse.

Thanks.

gunslingor
  • 1,358
  • 12
  • 34
  • `argparse` is just `printing` that help line. What you see in the `help` is the same as you get with `print()`. It's the console that isn't showing italics. – hpaulj Jul 13 '17 at 18:57
  • hmmm... not 100% sure about that. I noticed that "\n" gets stripped out of the help when there, so I don't think it's just echoing raw text to the console because the above solution should work in that case. – gunslingor Jul 13 '17 at 19:02
  • The default formatter does rework the line wrapping. You have to use a `RAW` formatter to preserve newlines. – hpaulj Jul 13 '17 at 19:06
  • Does it print the escape sequences or are they not shown? The italic is not a default escape sequence so maybe it's not supported. Also if italic is supported it is '\e[3m'. – rfkortekaas Jul 15 '17 at 14:12
  • Doesn't print anything different than if it wasn't there, as if they are stripped. I guess the question has no appropriate answer without jerry rigging, which isn't worth it. – gunslingor Jul 20 '17 at 13:56

0 Answers0