摘要: 如图,B 继承 A, C 继承 A, D 继承 B 和 C。 深度优先遍历是从 D 开始往上搜索到 B,若 B 没有数据,则继续往上搜索到 A; 广度优先遍历是从 D 开始往上搜索到 B,若 B 没有数据,则搜索和 B 同级的 C 里的数据,若同级的 C 里还是没有数据,再继续往上搜索到 A 。 T 阅读全文
posted @ 2020-11-06 16:06 天妖姥爷 阅读(437) 评论(0) 推荐(0) 编辑
摘要: #该处实现继承、定义私有方法、定义私有属性,获取私有属性 class Animal: __privateSx=1000 #定义了一个私有的属性,属性的名字是 __privateSx,私有属性只能通过指定方法获取 def getPrivate(self): print("获取私有属性,%s"%(sel 阅读全文
posted @ 2020-11-06 15:38 天妖姥爷 阅读(88) 评论(0) 推荐(0) 编辑
摘要: import requestsimport jsonimport urllibdef getSogouImag(path): imgs = requests.get('https://pic.xx.com/napi/pc/searchList?mode=13&dm=4&cwidth=1920&che 阅读全文
posted @ 2020-11-06 14:24 天妖姥爷 阅读(345) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/python # coding: utf-8 import requests,socket,json,os #重启halo博客 def frpc_reload(): os.system("ps -a | grep halo | xargs kill -9 2>/dev/null 阅读全文
posted @ 2020-11-06 10:30 天妖姥爷 阅读(746) 评论(0) 推荐(0) 编辑