Approved: Fortect
Here are some easy ways that should help you fix the error other than getopt.getopterror. Getopt.GetoptError Exception: Thrown if an unrecognized parameter can be found in the argument list, or if the parameter that requires an argument is not supplied. The exception argument is actually a string indicating the reason for the error type. The msg and opt attributes acquire an error message and a corresponding parameter.
try: opts, args equals getopt.getopt (sys.argv [1:], 'P: D: H: d: u: p: nvhmJi: c: Ml: TB:', ['host =', 'port =', 'directory =', 'user =', 'password =', 'daemon =', 'noauth', 'help', 'verbose', 'mysql', 'icounter =', 'config =', 'nolock', 'nomime', 'loglevel', 'noiter', 'baseurl ='])except getopt.GetoptError, e: Using printing print '>>>>% s' error: percentage point str (e) sys.exit (2)
file "main.py" character line 199except getopt.GetoptError, e:SyntaxError: invalid syntax
This is 30Sample code for using the getopt.GetoptError () share.These extracted examples are actually taken from open source projects.You can vote for the ones you like or the cheaper ones that you don’t like.and go from source project or source file – follow the links above each example.
Your check may indicate the use of the sidebar API.
You can also check all available functions / classes of some modulesoutperformor try the