09 2024 档案
摘要:方法一:使用pip freeze命令 pip freeze > requirements.txt 这个命令会将当前环境中所有安装的包及其版本写入到requirements.txt文件中。 方法二:使用pipreqs工具 首先需要安装pipreqs: pip install pipreqs 然后运行p
阅读全文
摘要:在Java中,StrUtil 是一个常用的字符串工具类,通常来自于Hutool库。以下是 StrUtil.isNotEmpty(),StrUtil.isNotBlank(),StrUtil.isEmpty() 和 StrUtil.isBlank() 的区别: StrUtil.isNotEmpty(S
阅读全文
摘要:查看当前状态 mysql> SHOW VARIABLES LIKE '%general%'; 启用 临时启用 SET GLOBAL general_log=on; SET GLOBAL general_log_file='/tmp/general.log'; 永久启用 通过修改配置文件来启用,需要重
阅读全文
摘要:import os def get_current_user(): # whoami命令返回的信息中,第一个"/"之后的内容就是用户名 # 我们使用split("/")方法获取用户名 whoami_output = os.popen("whoami").read() return whoami_ou
阅读全文
摘要:import datetime import sys import time def func(mail): print('参数:{0}'.format(mail)) print('时间:{0}'.format(datetime.datetime.now())) print('-' * 30) de
阅读全文