Re: [Tutor] Exceptions and its error messages

2005-08-28 Thread lumbricus
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

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread Kent Johnson
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

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread Jonas Melian
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

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread Kent Johnson
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

Re: [Tutor] Exceptions and its error messages

2005-05-25 Thread jfouhy
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. _

[Tutor] Exceptions and its error messages

2005-05-25 Thread Jonas Melian
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