I use optparse module to parse the options that I make, and it automatically generates usage message to print with -h option.
How can I get the usage message as a string in a python script? I'd like to print out it when something's wrong with parsing.
optparseis deprecated since 2.7 (replaced byargparse) - miku