Help with optionparse recipe
stephen.no at spam.theboulets.net.please
Tue Jul 27 07:40:46 CEST 2004
I'm having trouble with the "optionparse" recipe in the cookbook:
This does not give me the results I expected (namely the arguments on the
command line for each flag):
"""An example script invoking optionparse, my wrapper around optparse.
usage: %prog [options] args
-f, --file: file to attach
-s, --subject: email subject
-a, --address: email address
opt, args = optionparse.parse(__doc__)
if not opt and not args:
$ python opttest.py -f "myfile.txt" -s "Here's the file" \
-a someone at there.net
What am I doing wrong here?
If your desktop gets out of control easily,
you probably have too much stuff on it that
doesn't need to be there.
Donna Smallin, "Unclutter Your Home"
More information about the Python-list