摘要: 1、# 先确认并开启firewalld服务 $ sudo systemctl status firewalld $ sudo systemctl enable firewalld $ sudo systemctl start firewalld # 直接编辑xml配置文件,比用firewall-cm 阅读全文
posted @ 2020-12-24 12:24 wxl106 阅读(531) 评论(0) 推荐(0) 编辑
摘要: 1.可使用命令直接进行,数据已清空(前提) ALTER TABLE TableName AUTO_INCREMENT=1; 2.在没有关联外键,或者关联外键的其他表的子数据已经清除,使用命令修改ID初始值 TRUNCATE TABLE TABLENAME; 另外,TRUNCATE删除数据时,速度比D 阅读全文
posted @ 2020-12-16 09:23 wxl106 阅读(489) 评论(0) 推荐(0) 编辑
摘要: #Path #需要清空的文件夹 #daysago 日期 import os, datetime,sysreload(sys)sys.setdefaultencoding('utf8')dirToBeEmptied = Path #需要清空的文件夹daysago=int(daysago)ds = li 阅读全文
posted @ 2020-06-23 19:48 wxl106 阅读(370) 评论(0) 推荐(0) 编辑
摘要: import datetimeimport redisclass RedisSignIn(): def __init__(self): # 连接redis数据库 self.redis_store = redis.Redis( host="127.0.0.1", port='6379', db="1" 阅读全文
posted @ 2019-09-16 11:47 wxl106 阅读(1043) 评论(0) 推荐(0) 编辑
摘要: 1. 设置自己本地的 ssh-key,关联到 git 的 key 中 打开 gitbash A. 查看是否已经有 ssh 密钥 cd ~/.ssh ls 是否显示有 id_rsa.pub catid_rsa.pub 进行复制 (如果有的话) B. 创建 ssh 密钥 ssh-keygen -t rs 阅读全文
posted @ 2019-09-10 15:50 wxl106 阅读(136) 评论(0) 推荐(0) 编辑
摘要: def timer(f): #闭包,这里闭包的不是变量,而是形参f def inner(): print("执行函数前") f() print("执行函数后") return inner@timerdef func(): print('hello ,装饰器') time.sleep(0.1)f1=f 阅读全文
posted @ 2019-09-09 10:06 wxl106 阅读(115) 评论(0) 推荐(0) 编辑
摘要: # 指定数的阶乘def sum(n): if n==1: return n else: return n*sum(n-1)num=sum(5)print(num) # 阶乘递归求和def total_sum(m): total=0 for i in range(1,m+1): def sum(n): 阅读全文
posted @ 2019-09-09 09:30 wxl106 阅读(327) 评论(0) 推荐(0) 编辑
摘要: # coding=utf-8"""发送邮件"""import smtplibfrom email.mime.text import MIMETextfrom email.header import Headerdef send_mail(content=""): print("send_mail") 阅读全文
posted @ 2019-08-24 17:58 wxl106 阅读(253) 评论(0) 推荐(0) 编辑
摘要: data_list=["任务列表,开奖开始时间lottery_date,开奖结束时间end_time,时间间隔lottery_time_num"]# 可以带分钟的间隔整时开奖f_time = 3 * 60for obj in data_list: p_time = obj.lottery_time_ 阅读全文
posted @ 2019-08-24 15:35 wxl106 阅读(167) 评论(0) 推荐(0) 编辑
摘要: python 中常见的魔术方法: 1、__init__(self, item):方法 在实例化对象时自动执行,多用于对对象属性进行初始化。 2、__new__(cls,item):方法 实例化对象时自触发,在__init__ 方法之前执行,作为控制对象的生成过程,实现单例设计模式。 3、__del_ 阅读全文
posted @ 2019-08-14 17:52 wxl106 阅读(382) 评论(0) 推荐(0) 编辑