0

The argparse documentation speaks of four different formatter classes to control the output of the help string to some extend. I find several of them useful.

Can I use several of them together?

E.g. argparse.RawDescriptionHelpFormatter and argparse.ArgumentDefaultsHelpFormatter

steffen
  • 8,572
  • 11
  • 52
  • 90
  • 1
    as I know you can create own formatter. And probably it should be described in documentation. – furas Jun 20 '20 at 01:11
  • 1
    [Customize argparse help message](https://stackoverflow.com/questions/35847084/customize-argparse-help-message) - in one of answer you can see how to create own formatter. – furas Jun 20 '20 at 01:14
  • 1
    Yes you can use several together. One way is to define a new formater subclass that inherits from existing ones. Also take sometime to look at how those classes change the base class. They just redefine a couple of the methods. In particular note how one of those classes just adds a `' (default: %(default)s)'` string to all your `help` lines. – hpaulj Jun 20 '20 at 02:43

0 Answers0