摘要:
#客户端import socketclient = socket.socket() #声明socket类型,同时生成socket连接对象client.connect(('localhost',6969))while True: msg = input(">>:").strip() if len(ms 阅读全文
摘要:
class AlexError(Exception): def __init__(self, msg): self.message = msg # def __str__(self): # return 'sdfsf'try: raise AlexError('数据库连不上')except Alex 阅读全文
摘要:
http://www.cnblogs.com/wupeiqi/articles/5017742.html python中的异常种类非常多,每个异常专门用于处理某一项异常!!! try: # 主代码块 passexcept KeyError,e: # 异常时,执行该块 passelse: # 主代码块 阅读全文
摘要:
def bulk(self): print("%s is yelling...." %self.name)class Dog(object): def __init__(self,name): self.name = name def eat(self,food): print("%s is eat 阅读全文