Skip to content

Instantly share code, notes, and snippets.

@geo5555
geo5555 / argparse_optional_argument.py
Created October 12, 2019 19:09 — forked from pknowledge/argparse_optional_argument.py
Python, argparse, and command line arguments example
import argparse
if __name__ == '__main__':
# Initialize the parser
parser = argparse.ArgumentParser(
description="my math script"
)
# Add the parameters positional/optional
parser.add_argument('-n','--num1', help="Number 1", type=float)