Skip to content

Commit

Permalink
Add demo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rissangs committed Nov 19, 2020
1 parent 1ac1038 commit 3ae74f9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# author: Tiffany Timbers
# date: 2020-01-15

"""This script prints out docopt args.
Usage: docopt.py <arg1> --arg2=<arg2> [--arg3=<arg3>] [<arg4>]
Options:
<arg> Takes any value (this is a required positional argument)
--arg2=<arg2> Takes any value (this is a required option)
[--arg3=<arg3>] Takes any value (this is an optional option)
[<arg4>] 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["<arg4>"])

0 comments on commit 3ae74f9

Please sign in to comment.