Preview:
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-c', '--com-port', metavar='N', type=int, required=True, help='HART modem com port')
parser.add_argument('-s', '--slave-address', metavar='N', type=int, default=0, help='HART slave address')
parser.add_argument('-l', '--log', action='store_true', help='log to file')
parser.add_argument('-v', '--verbose', action='store_true', help='print values to console')
args = parser.parse_args()

logger = setup_logging(args.verbose, args.log)
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter