Hello!
Don't know if someone wrote this already.
>But how knowing all error messages from some module?
>Is there any way of knowing from python interactive line?
>>> for i in dir(__builtins__):
>>> if i.endswith("Error"): print i
HTH and Greets, J"o!
--
Wir sind jetzt ein Imperium und wi
Jonas Melian wrote:
> I use i.e. with OSError exception the next error messages:
> err_o.strerror, err_o.filename
>
> ::
> try:
> (os.listdir(x))
> except OSError, err_o:
> print "Error! %s: %r" % (err_o.strerror, err_o.filename)
> ::
>
> But how knowing all error messages from some modul
Kent Johnson wrote:
> Jonas Melian wrote:
>> How to know all the exceptions that there are? (i.e. OSError, ImportError)
>
> Some library modules define their own exceptions such as socket.error so
> the above is not a complete
> list of exceptions defined in the standard distribution, just the one
Jonas Melian wrote:
> How to know all the exceptions that there are? (i.e. OSError, ImportError)
The built-in exceptions are documented here:
http://docs.python.org/lib/module-exceptions.html
Some library modules define their own exceptions such as socket.error so the
above is not a complete
li
Quoting Jonas Melian <[EMAIL PROTECTED]>:
> How to know all the exceptions that there are? (i.e. OSError,
> ImportError)
Check the Python library reference (on python.org); section 2.4: Built-in
exceptions.
Of course, you can subclass Exception to build your own!
--
John.
_
Hi,
How to know all the exceptions that there are? (i.e. OSError, ImportError)
And all error messages of each exception? (i.e. err_o.strerror,
err_o.filename)
Thanks in advance!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/list