上一页 1 2 3 4 5 6 7 8 ··· 25 下一页
摘要: import os def get_current_user(): # whoami命令返回的信息中,第一个"/"之后的内容就是用户名 # 我们使用split("/")方法获取用户名 whoami_output = os.popen("whoami").read() return whoami_ou 阅读全文
posted @ 2024-09-02 15:13 darling331 阅读(151) 评论(0) 推荐(0)
摘要: 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 阅读(87) 评论(0) 推荐(0)
摘要: 准备一台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 阅读(497) 评论(0) 推荐(0)
摘要: 背景 针对线上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 阅读(105) 评论(0) 推荐(0)
摘要: 查看自己google浏览器的版本 下载与之对应的google浏览器驱动 将驱动配置放到和python.exe的同级目录下,如果不知道python在哪里可以打开cmd where python 开始自动化调用 import time from selenium import webdriver # 创 阅读全文
posted @ 2024-08-02 11:34 darling331 阅读(64) 评论(0) 推荐(0)
摘要: 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 阅读(39) 评论(0) 推荐(0)
摘要: 手机上的效果图 需要注意,手机触摸和鼠标不是一个事件,不能通用,上一篇是关于使用鼠标的样例 相关代码 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width 阅读全文
posted @ 2024-07-18 18:41 darling331 阅读(104) 评论(0) 推荐(0)
摘要: 运行效果 代码样例 <!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 阅读(43) 评论(0) 推荐(0)
摘要: 查询占用端口 netstat -ano | findstr :19201 kill 占用端口的进程 taskkill /PID 19201 /F 阅读全文
posted @ 2024-07-16 17:05 darling331 阅读(33) 评论(0) 推荐(0)
摘要: 新版本的Python(我用的是比较新的3.12)可能会遇到没有“distutils”的情况,切换或者装一个低版本的可以解决,但是比较麻烦,偶然发现一个新的解决办法 pip install setuptools “setuptools”是一个处理Python软件包的工具包,它依赖于 distutils 阅读全文
posted @ 2024-07-10 18:57 darling331 阅读(2661) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 25 下一页