From 3ae74f90b93c22fe392b74ca088c390486f6a066 Mon Sep 17 00:00:00 2001 From: Sang Yoon Lee Date: Thu, 19 Nov 2020 15:06:31 +0900 Subject: [PATCH] Add demo.py --- demo.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 demo.py diff --git a/demo.py b/demo.py new file mode 100644 index 0000000..7a49e76 --- /dev/null +++ b/demo.py @@ -0,0 +1,23 @@ +# author: Tiffany Timbers +# date: 2020-01-15 + +"""This script prints out docopt args. +Usage: docopt.py --arg2= [--arg3=] [] + +Options: + Takes any value (this is a required positional argument) +--arg2= Takes any value (this is a required option) +[--arg3=] Takes any value (this is an optional option) +[] Takes any value (this is an optional positional argument) +""" + +from docopt import docopt +opt = docopt(__doc__) + +def main(opt, arg4): + print(opt) + print(type(opt)) + print(f'The value of arg4 is {arg4} and the type of arg4 is {type(arg4)}') + +if __name__ == "__main__": + main(opt, opt[""]) \ No newline at end of file