Answers for "python print a help of a script"

0

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()
Posted by: Guest on September-20-2021

Code answers related to "python print a help of a script"

Python Answers by Framework

Browse Popular Code Answers by Language