摘要: 1、面向对象 class: 类: 一个模板、模型 对象、实例: 通过模型制作出来的东西 实例化:制作实例的过程 self :本类对象 私有: 私有方法、私有变量,就是出了类之后就不能调用了 私有方法:方法名前加上"__"可定义为私有方法 私有变量:变量名前加上"__"可定义为私有变量 __init_ 阅读全文
posted @ 2021-07-02 00:17 黑。白。 阅读(39) 评论(0) 推荐(0) 编辑
摘要: from loguru import logger import sys # loguru.logger.info("aaaa") # loguru.logger.debug() # # loguru.logger.info() # # loguru.logger.warning() # # log 阅读全文
posted @ 2021-07-01 23:48 黑。白。 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 1 import pymysql 2 from day8.homework.const import mysql_info 3 class MySQL: #经典类 4 5 def __init__(self,mysql_info,data_type=1): 6 self.mysql_info = m 阅读全文
posted @ 2021-07-01 23:46 黑。白。 阅读(101) 评论(0) 推荐(0) 编辑
摘要: import yamail# 邮箱username# passwordusername = "xxx@qq.com"password = "xxx"host = "smtp.qq.com" #qq# host = "smtp.163.com" #163# host = "smtp.126.com" 阅读全文
posted @ 2021-06-16 23:47 黑。白。 阅读(46) 评论(0) 推荐(0) 编辑
摘要: import requestsurl = "https://oapi.dingtalk.com/robot/send"import timeimport hmacimport hashlibimport base64import urllib.parsedef get_dd_sign(): time 阅读全文
posted @ 2021-06-16 23:46 黑。白。 阅读(246) 评论(0) 推荐(0) 编辑
摘要: # l = [1,2,3]# d = {"name":"11"}# import traceback# try:# name = d["name"]# # l[4]# # except KeyError as e:# # print(e)# # print("出现异常了")# # except In 阅读全文
posted @ 2021-06-16 23:44 黑。白。 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 1、网络请求 urllib 自带模块: 1、get 请求 2、post 请求 3、url 里面传参 4、body、josn 5、cookie 6、header 7、上传文件 8、k-v from urllib.request import urlopen from urllib.parse impo 阅读全文
posted @ 2021-06-16 23:41 黑。白。 阅读(924) 评论(0) 推荐(0) 编辑
摘要: # import xlrd# book = xlrd.open_workbook("test.xls")# # sheet = book.sheet_by_name("sheet1")# sheet = book.sheet_by_index(0)# # book.sheets() #获取所有she 阅读全文
posted @ 2021-06-16 23:40 黑。白。 阅读(57) 评论(0) 推荐(0) 编辑
摘要: redis 是一个数据库,他是非关系型数据库,nosql类型k-v 格式redis数据全部放在内存里面,每秒钟最大能支持10w的读写import redisr = redis.Redis(host="x.x.x.x",password="xxx",port=6379,db=4,decode_resp 阅读全文
posted @ 2021-06-16 23:39 黑。白。 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 在使用kubeadm init初始化k8s集群中的master主节点时,总是出错。这个地方卡了我很长时间,遇到了好几个不一样的错误,有的问题在网上也没有找到什么有效的解决方案,所以特此记录一下。以下错误均是在使用kubeadm init语句初始化k8s集群过程中出现的问题。 第一次初始化集群时,我的 阅读全文
posted @ 2021-06-13 10:01 黑。白。 阅读(2229) 评论(0) 推荐(0) 编辑