On this page
  1. getopt.GetoptError
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

getopt.GetoptError

Prev: getopt.getopt | Up: getopt | Next: getopt.gnu_getopt
Rel: getopt.error, getopt.getopt, getopt.gnu_getopt
Ref: docs.python.org โ€” getopt.GetoptError
Tags: #public #python3 #stdlib #getopt


Import

import getopt
from getopt import GetoptError

Signature & Overview

getopt.GetoptError(msg, opt='')

getopt.GetoptError class.

Methods & Attributes

Usage

import getopt

try:
    getopt.getopt(["-z"], "ab:")
except getopt.GetoptError as exc:
    assert exc.opt == "z"

Gotchas

REPL Inspect

from getopt import GetoptError
help(GetoptError)

Linked from

Related notes