Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python print a help of a script

# credit to the Stack Overflow user in the source link
import argparse

parser=argparse.ArgumentParser(
    description='''My Description. And what a lovely description it is. ''',
    epilog="""All is well that ends well.""")
parser.add_argument('--foo', type=int, default=42, help='FOO!')
parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')
args=parser.parse_args()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #print #script
ADD COMMENT
Topic
Name
2+6 =