getopt issues

Steven Taschuk staschuk at telusplanet.net
Wed Aug 27 01:19:27 EDT 2003


Quoth David Bear:
> >>> args
> '-Middwb at mainex1.asu.edu -AKHAAM at prlinux+898 [...]
  [...]
> >>> a, b = getopt.getopt(args, 'APQn')

getopt wants its arguments as a list of strings (like sys.argv),
not one big string.  Here, for example,

    >>> a, b = getopt.getopt(args.split(), 'APQn')
    Traceback (most recent call last):
      ...
    getopt.GetoptError: option -M not recognized

as expected.

-- 
Steven Taschuk                                                 o- @
staschuk at telusplanet.net                                      7O   )
                                                               "  (





More information about the Python-list mailing list