会员
周边
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
darling
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
···
25
下一页
2024年9月3日
mysql 使用 general 开启SQL跟踪功能
摘要: 查看当前状态 mysql> SHOW VARIABLES LIKE '%general%'; 启用 临时启用 SET GLOBAL general_log=on; SET GLOBAL general_log_file='/tmp/general.log'; 永久启用 通过修改配置文件来启用,需要重
阅读全文
posted @ 2024-09-03 17:23 darling331
阅读(76)
评论(0)
推荐(0)
2024年9月2日
python通过执行命令获取windows的用户名
摘要: import os def get_current_user(): # whoami命令返回的信息中,第一个"/"之后的内容就是用户名 # 我们使用split("/")方法获取用户名 whoami_output = os.popen("whoami").read() return whoami_ou
阅读全文
posted @ 2024-09-02 15:13 darling331
阅读(179)
评论(0)
推荐(0)
python 监听键盘事件,调用指定函数,以及在程序退出时调用函数处理退出后得事情
摘要: import datetime import sys import time def func(mail): print('参数:{0}'.format(mail)) print('时间:{0}'.format(datetime.datetime.now())) print('-' * 30) de
阅读全文
posted @ 2024-09-02 14:59 darling331
阅读(95)
评论(0)
推荐(0)
2024年8月12日
cx_Freeze 打包生成Linux可执行文件
摘要: 准备一台linux系统环境 安装 cx_Freeze pip install cx_Freeze 准备两个py脚本 1,app应用脚本,需要打包的 app.py import random import time from flask import Flask, jsonify from concu
阅读全文
posted @ 2024-08-12 14:46 darling331
阅读(529)
评论(0)
推荐(0)
2024年8月9日
脚本执行报错 cp: cannot stat '/home/dar/app/log_back'$'\r''/nohup.out': No such file or d
摘要: 背景 针对线上nohup日志较大,需要进行拆分,所以写了一个脚本文件,用来定时执行(或者手动执行) 脚本一 log_dir="/home/dar/app/log_back" # 拷贝日志文件到昨天的log中 cp $log_dir/nohup.out $log_dir/nohup-$(date +"
阅读全文
posted @ 2024-08-09 18:28 darling331
阅读(120)
评论(0)
推荐(0)
2024年8月2日
使用chrome浏览器驱动自动打开浏览器
摘要: 查看自己google浏览器的版本 下载与之对应的google浏览器驱动 将驱动配置放到和python.exe的同级目录下,如果不知道python在哪里可以打开cmd where python 开始自动化调用 import time from selenium import webdriver # 创
阅读全文
posted @ 2024-08-02 11:34 darling331
阅读(80)
评论(0)
推荐(0)
2024年8月1日
python根据指定字符串截取特定字符
摘要: if __name__ == '__main__': a='单据ddd明细中商品01010130088ddd0001未1111dd上传DDD' print(len(a)) start_index=a.find("品") + 1 start_index1 = a.find("未") end_index
阅读全文
posted @ 2024-08-01 22:31 darling331
阅读(61)
评论(0)
推荐(0)
2024年7月18日
html+canvas 实现签名功能-手机触摸
摘要: 手机上的效果图 需要注意,手机触摸和鼠标不是一个事件,不能通用,上一篇是关于使用鼠标的样例 相关代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width
阅读全文
posted @ 2024-07-18 18:41 darling331
阅读(120)
评论(0)
推荐(0)
html+canvas 实现签名功能-鼠标
摘要: 运行效果 代码样例 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title
阅读全文
posted @ 2024-07-18 11:10 darling331
阅读(55)
评论(0)
推荐(0)
2024年7月16日
windows 查询端口占用,并kill占用端口的进程
摘要: 查询占用端口 netstat -ano | findstr :19201 kill 占用端口的进程 taskkill /PID 19201 /F
阅读全文
posted @ 2024-07-16 17:05 darling331
阅读(48)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
···
25
下一页
公告