摘要: 一.模块安装 pip3 install schedule 二.常用的使用案例 #基本格式#创建方法def func(): print("方法")#创建定时schedule.every().seconds.do(func) #每秒运行一次#如果方法需要传参的话do(func,参数1)#开循环while 阅读全文
posted @ 2021-06-10 23:53 黑。白。 阅读(3622) 评论(0) 推荐(0)
摘要: 1、安装第三方模块 1、手动安装 whl: pip install xpinyin-0.7.6-py3-none-any.whl tar.gz 解压 cd xpinyin-0.7.6 python setup.py install 2、自动化安装 python的安装目录 加入到环境变量里面 pyth 阅读全文
posted @ 2021-05-28 01:58 黑。白。 阅读(938) 评论(0) 推荐(0)
摘要: 这条语句适用于MySQL8.0之前的 而MySQL8.0及之后的,设置远程连接权限要用下面的语句才可以 create user root@'%' identified by '123456'; grant all privileges on *.* to root@'%' with grant op 阅读全文
posted @ 2021-05-23 22:59 黑。白。 阅读(8110) 评论(0) 推荐(2)
摘要: 注意:安装之前请卸载干净navicat,不要覆盖安装 1、去官网下载Navicat premium15的安装包 官网地址:https://www.navicat.com.cn/download/navicat-premium 2、双击安装文件,无脑next 安装,记住安装的位置 3、安装完成之后不要 阅读全文
posted @ 2021-05-22 22:38 黑。白。 阅读(2027) 评论(0) 推荐(0)
摘要: 1、内置函数 常用的内置函数: #sum min max round zip divmod locals sorted filter map sum() 求和 min() 最小值 max() 最大值 avg = sum(l) / len(l) #计算平均值 round() 保留几位小数 zip() 阅读全文
posted @ 2021-05-16 16:34 黑。白。 阅读(137) 评论(0) 推荐(0)
摘要: def str_to_timestamp(s=None,format="%Y-%m-%d %H:%M:%S"): ''' :param s: 格式化好的时间,比如2021-5-16 17:06:32 :param format: 时间格式 %Y-%m-%d %H:%M:%S :return: 返回的 阅读全文
posted @ 2021-05-16 16:32 黑。白。 阅读(137) 评论(0) 推荐(0)
摘要: def is_float(s): s = str(s) if s.count('.') == 1: left,right = s.split('.') #[1,1]#-s.2 if left.isdigit() and right.isdigit(): return True elif left.s 阅读全文
posted @ 2021-05-12 08:42 黑。白。 阅读(250) 评论(0) 推荐(0)
摘要: import timeFILE_NAME = 'access.log'point = 0while True: ips = {} f = open(FILE_NAME,encoding='utf-8') f.seek(point) if point == 0: #判断是否为第一次读取 f.read( 阅读全文
posted @ 2021-05-12 08:40 黑。白。 阅读(151) 评论(0) 推荐(0)
摘要: 1、解包 msg = "admin,123456" username,password = msg.split(',') 2、文件操作 r+ w+ a+ #读写 写读 追加读模式 #r相关,文件不存在都会报错,他的文件指针是在最前面的 #w相关,都会创建文件,都会清空文件内容 #a相关,如果你要读, 阅读全文
posted @ 2021-05-12 08:39 黑。白。 阅读(138) 评论(0) 推荐(0)
摘要: # num =[1,2,3,4,5]# f = open("a.txt","w",encoding="utf-8")#1打开文件不存在会报错# # for i in num:# # i = str(i )+ "\n"# # f.write(i)#只能写字符串# # f.writelines(num) 阅读全文
posted @ 2021-04-28 23:02 黑。白。 阅读(45) 评论(0) 推荐(0)