class shortException(Exception):
def int(self,length,atleast):
Exception.__int__(self)
self.length=length
self.atleast=atleast
try:
b=3
a =raw_input('ple input a word>>')
if len(a)<b:
raise shortException(len(a),b)
except EOFError:
print 'don\'t input EOFError'
except shortException,x:
print 'this number length is %d and aeleast is %d'%(x.length,x.atleast)
except AttributeError:
print'wokao'
else:
print 'the length is %s'%a
a byte of python里面的一个例子,为什么老是提示没有length属性
异常信息:AttributeError: 'shortException' object has no attribute 'length'
能否解答下···,详细点,TKS