会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wxl106
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2020年12月24日
firewalld防火墙配置
摘要: 1、# 先确认并开启firewalld服务 $ sudo systemctl status firewalld $ sudo systemctl enable firewalld $ sudo systemctl start firewalld # 直接编辑xml配置文件,比用firewall-cm
阅读全文
posted @ 2020-12-24 12:24 wxl106
阅读(632)
评论(0)
推荐(0)
2020年12月16日
mysql恢复主键从1自增
摘要: 1.可使用命令直接进行,数据已清空(前提) ALTER TABLE TableName AUTO_INCREMENT=1; 2.在没有关联外键,或者关联外键的其他表的子数据已经清除,使用命令修改ID初始值 TRUNCATE TABLE TABLENAME; 另外,TRUNCATE删除数据时,速度比D
阅读全文
posted @ 2020-12-16 09:23 wxl106
阅读(524)
评论(0)
推荐(0)
2020年6月23日
删除指定路径下,指定时间的文件
摘要: #Path #需要清空的文件夹 #daysago 日期 import os, datetime,sysreload(sys)sys.setdefaultencoding('utf8')dirToBeEmptied = Path #需要清空的文件夹daysago=int(daysago)ds = li
阅读全文
posted @ 2020-06-23 19:48 wxl106
阅读(400)
评论(0)
推荐(0)
2019年9月16日
利用redis的bitmap实现用户签到功能
摘要: 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
阅读(1071)
评论(0)
推荐(0)
2019年9月10日
github使用总结
摘要: 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
阅读(147)
评论(0)
推荐(0)
2019年9月9日
装饰器学习
摘要: 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
阅读(118)
评论(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
阅读(339)
评论(0)
推荐(0)
2019年8月24日
脚本邮箱监控
摘要: # 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
阅读(259)
评论(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
阅读(174)
评论(0)
推荐(0)
2019年8月14日
常用魔术方法总结
摘要: python 中常见的魔术方法: 1、__init__(self, item):方法 在实例化对象时自动执行,多用于对对象属性进行初始化。 2、__new__(cls,item):方法 实例化对象时自触发,在__init__ 方法之前执行,作为控制对象的生成过程,实现单例设计模式。 3、__del_
阅读全文
posted @ 2019-08-14 17:52 wxl106
阅读(400)
评论(0)
推荐(0)
1
2
下一页
公告