Albert Lukaszewski

Kutipan

DDaudalagidmembuat kutipan2 tahun yang lalu
An exception is only explicitly registered when raise is used. Instead of the print statement used in the except clause previously, we can raise an error and update the print statement with the following line of code:
raise MySQLdb.Error
Instead of the friendly statement about an error passing, we get a stack trace that ends as follows:
_mysql_exceptions.Error
DDaudalagidmembuat kutipan2 tahun yang lalu
except MySQLdb.Error, e:
print "An error has been passed. %s" %e
DDaudalagidmembuat kutipan2 tahun yang lalu
For exceptions see:
http://python.about.com/od/pythonstandardlibrary/a/lib_exceptions.htm
For warnings visit:
http://python.about.com/od/pythonstandardlibrary/a/lib_warnings.htm
The Python documentation also covers them at:
http://docs.python.org/library/exceptions.html

References

fb2epub
Seret dan letakkan file Anda (maksimal 5 sekaligus)