diff options
Diffstat (limited to 'modules/language/python/module/test2.py')
-rw-r--r-- | modules/language/python/module/test2.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/language/python/module/test2.py b/modules/language/python/module/test2.py new file mode 100644 index 0000000..0d59a6c --- /dev/null +++ b/modules/language/python/module/test2.py @@ -0,0 +1,28 @@ +module(test2) +from optparse import OptionParser + +def f(args): + parser = OptionParser(usage="usage: %prog [options] filename", + version="%prog 1.0") + + parser.add_option("-x", "--xhtml", + action="store_true", + dest="xhtml_flag", + default=False, + help="create a XHTML template instead of HTML") + + parser.add_option("-c", "--cssfile", + action="store", # optional because action defaults to "store" + dest="cssfile", + default="style.css", + help="CSS file to link") + + (options, args) = parser.parse_args(args) + + if len(args) != 1: + parser.error("wrong number of arguments") + + print(options) + print(args) + +__all__=['f'] |