摘要:
一.类、实例化(对象)、继承、多态 #创建类 class Human(object): """ 这里是文档注释 """ type = "人类" #类变量 def __init__(self,name,age): #初始化方法 self.name = name #实例化属性(变量) self.age 阅读全文
posted @ 2020-03-01 18:29
Crown-V
阅读(175)
评论(0)
推荐(0)
摘要:
一.多态 #类的多态 class Animal(object): #Animal类继承object def __init__(self,color): self.color = color def eat(self): print("动物在吃!") def run(self): print("动物在 阅读全文
posted @ 2020-03-01 13:27
Crown-V
阅读(171)
评论(0)
推荐(0)
摘要:
一.类的继承 #类的继承 class Animal(object): #Animal类继承object def __init__(self,color): self.color = color def eat(self): print("动物在吃!") def run(self): print("动 阅读全文
posted @ 2020-03-01 13:17
Crown-V
阅读(201)
评论(0)
推荐(0)
摘要:
一.类的封装 #类的封装 class Card(object): def __init__(self,num,pwd,ban): self.num = num self.pwd = pwd self.__ban = ban #封装(私有变量) def __cun(self): #方法私有 print 阅读全文
posted @ 2020-03-01 12:56
Crown-V
阅读(229)
评论(0)
推荐(0)
摘要:
一.类的创建 #类的实例化 class Dog(object):#object类,o小写 type = "宠物" #类变量 def __init__(self,name,age): #初始化方法 self.name = name #实例变量(属性) self.age = age self.run() 阅读全文
posted @ 2020-03-01 09:55
Crown-V
阅读(1422)
评论(0)
推荐(0)
摘要:
一.简单的通信(客户端) #client客户端.py import socket client = socket.socket() #生成socket连接对象 client.connect(("localhost",8088)) #和目标机简历连接 while True: data = str(in 阅读全文
posted @ 2020-03-01 08:56
Crown-V
阅读(231)
评论(0)
推荐(0)

浙公网安备 33010602011771号