Display help message with python argparse when script is called without any arguments
问题 This might be a simple one. Assume I have a program that uses argparse to process command line arguments/options. The following will print the \'help\' message: ./myprogram -h or: ./myprogram --help But, if I run the script without any arguments whatsoever, it doesn\'t do anything. What I want it to do is to display the usage message when it is called with no arguments. How is that done? 回答1: This answer comes from Steven Bethard on Google groups. I'm reposting it here to make it easier for