30分请教个python小程序的执行错误
class ShortInputException(Exception): def __int__(self, length, atleast): Exception.__int__(self) self.length = length self.atleast = atleastl = 5try: s = raw_input('Enter something: ') if len(s) < l: raise ShortInputException(len(s), l)except EOFError: print 'EOF error, Please check ur input'except ShortInputException, x: print 'The input length is %d, should atleast be %d' % (x.length, x.atleast)else: print 'No exception was raised'def __int__(self, length, atleast):
[解决办法]
晕,发现的比你慢了。呵呵,刚打开就去吃东西了,嘿嘿。