摘要: # -- coding: utf-8 --#自定义异常class myException(Exception): passdef division(x,y): if y == 1 : raise myException('y==1') #假如当y==1时,抛出自定义异常 return x/ytry: division(1,0)except ZeroDi... 阅读全文
posted @ 2014-06-08 17:03 sxcww 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 由ip查域名:(family, type, proto, canonname, sockaddr)=socket.getaddrinfo(host, port, family=0, type=0, proto=0, flags=0)#-*- coding='gb2312' -*-import soc... 阅读全文
posted @ 2014-06-08 16:03 sxcww 阅读(188) 评论(0) 推荐(0) 编辑