Re: How to catch str exception?

2009-05-15 Thread Kurt Symanzik
ised which though deprecated but still a 3rd party library I use uses it. So how can I catch such exception without relying on catch all, which could be bad. system: Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Try this, i.e. catch the exact string:

Re: Why there is a parameter named "self" for classmethod function?

2009-05-06 Thread Kurt Symanzik
s such as: @classmethod def print_hello(cls): print "hello" But you might consider decorating the method as a static method instead since in your example you are not using the parameter at all. A static method would not require a parameter. @staticmethod def print_h