Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

argparse print help if no arguments

parser.argparse.ArgumentParser()
# parser.add_args here

# sys.argv includes a list of elements starting with the program
if len(sys.argv) < 2:
    parser.print_usage()
    sys.exit(1)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #argparse #print #arguments
ADD COMMENT
Topic
Name
1+2 =