> $ PYTHONPATH= python except > Traceback (most recent call last): > File "except", line 7, in <module> > except getopt.error, msg: > AttributeError: 'module' object has no attribute 'error' > > > The program is: > > $ cat except > #!/usr/bin/env python > > import getopt > > try: > opts, args = getopt.getopt (sys.argv[1:], "t:") > except getopt.error, msg: > raise "Usage: some other way", msg
I guess you are using Python 2. In any case you should import sys if you want to access sys.argv. Lutz
signature.asc
Description: OpenPGP digital signature
-- https://mail.python.org/mailman/listinfo/python-list