whats this mean?

Alex new_name at mit.edu
Sat Jul 21 05:45:55 CEST 2001


See http://www.python.org/doc/ref/try.html#l2h-439 for the syntax of
try/except.  "except socket.error, why" assigns the value raised with
the exception to the name "why".  Play with this a bit:

>>> try: raise SyntaxError('example')
... except SyntaxError, why: print why
... 
example
>>> 

Alex.



More information about the Python-list mailing list