上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 40 下一页
摘要: osi(open system internetwork reference model)七层协议为 :应用层、表示层、会话层、传输层、网络层、数据链路层、物理层 链路层 主要以以太网协议 包括两个部分header和data两个部分 head部分共18个字节 发送者\原地址(mac) 48位二进制也 阅读全文
posted @ 2020-03-18 13:29 竹石2020 阅读(107) 评论(0) 推荐(0)
摘要: 1 try: 2 age = input('请输入年龄') 3 int(age) 4 num2 = input('请输入') 5 int(num2) 6 l = list() 7 l[100] 8 except KeyError as e: 9 print(e) 10 except ValueErr 阅读全文
posted @ 2020-03-17 22:46 竹石2020 阅读(146) 评论(0) 推荐(0)
摘要: 一切的类都是通过type这个类来创建的,例如: 1 class Foo: 2 a = 1 3 pass 4 5 6 print(type(Foo)) 7 print(Foo.__dict__) 8 9 10 def __init__(self, name, age): 11 self.name = 阅读全文
posted @ 2020-03-16 21:05 竹石2020 阅读(94) 评论(0) 推荐(0)
摘要: 1 class Goods: 2 def __init__(self,price,discount): 3 self.price = price 4 self.discount = discount 5 6 @property 7 def price1(self): 8 return self.pr 阅读全文
posted @ 2020-03-16 15:40 竹石2020 阅读(137) 评论(0) 推荐(0)
摘要: 1 class property2: 2 def __init__(self, func): 3 print('执行property2') 4 self.func = func 5 6 def __get__(self, instance, owner): 7 print('执行get') 8 se 阅读全文
posted @ 2020-03-16 15:29 竹石2020 阅读(190) 评论(0) 推荐(0)
摘要: 1 class property2: 2 def __init__(self, func): 3 print('执行property2') 4 self.func = func 5 6 def __get__(self, instance, owner): 7 return self.func(in 阅读全文
posted @ 2020-03-16 12:19 竹石2020 阅读(133) 评论(0) 推荐(0)
摘要: 1 class Type: 2 def __init__(self, key, expcet_type): 3 self.key = key 4 self.expct_type = expcet_type 5 6 def __get__(self, instance, owner): 7 print 阅读全文
posted @ 2020-03-16 10:32 竹石2020 阅读(157) 评论(0) 推荐(0)
摘要: 1 def demo(obj): 2 print(' ') 3 obj.x = 1 4 obj.y = 2 5 obj.z = 3 6 return obj 7 8 @demo 9 class Foo: 10 pass 11 12 f1 = Foo() 13 print(Foo.__dict__) 阅读全文
posted @ 2020-03-13 21:48 竹石2020 阅读(167) 评论(0) 推荐(0)
摘要: 1 class Type: 2 def __init__(self,key): 3 self.key = key 4 5 def __get__(self, instance, owner): 6 print('执行get方法') 7 return instance.__dict__[self.ke 阅读全文
posted @ 2020-03-13 10:44 竹石2020 阅读(193) 评论(0) 推荐(0)
摘要: with open as f: 等同于 f = obj.__enter__() 代码块 with obj >触发obj.__enter__(),拿到返回值 as f >f = 返回值 执行代码块: 一:没有异常的情况下,整个代码块运行完毕后去触发__excit__,它的三个参数都为None 二:有异 阅读全文
posted @ 2020-03-11 17:21 竹石2020 阅读(196) 评论(0) 推荐(0)
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 40 下一页