I have a module that I'm writing an ipython notebook to document. I'd like to have part of that documentation be the response to calling the module from the command line with the --help flag - the parameters set up using argparse. Is there a simple way of getting that as a formatted string?
Add a comment
|
2 Answers
Call format_help() on your ArgumentParser instance. It will give you a string with the help text.