From 7bfa74d0a8861326b6e99ab9b15c2897da2f20fa Mon Sep 17 00:00:00 2001 From: wardwouts Date: Wed, 17 Jun 2020 06:35:34 +0200 Subject: [PATCH] a start --- stt.py | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 stt.py diff --git a/stt.py b/stt.py new file mode 100755 index 0000000..96fd43b --- /dev/null +++ b/stt.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 + +# include standard modules +import argparse +import os +import sys +import re +import json + +mydir = os.path.dirname(os.path.realpath(__file__)) + +def commandline(): + # initiate the parser + parser = argparse.ArgumentParser(description="Awesome tool to...") + # option without argument via 'store_true' + parser.add_argument("-V", "--version", help="show program version", action="store_true") + # option with argument + parser.add_argument("--width", "-w", help="set output width") + parser.add_argument("--input", "-i", help="set input file") + + # read arguments from the command line + args = parser.parse_args() + + # handle arguments + # check for --version or -V + if args.version: + print("this is myprogram version 0.1") + # check for --width + if args.width: + print("set output width to %s" % args.width) + + return args + + +def get_json(html): + result = re.search(r'