摘要: 导入 pip install Spire.XLS.Free 示例 解析 JSON 数据 → 创建 Excel 工作簿/工作表 → 写入表头与数据 → 保存文件。以下是完整实现代码: import json from spire.xls import * from spire.xls.common i 阅读全文
posted @ 2026-05-22 17:05 giyaYON 阅读(8) 评论(0) 推荐(0)
摘要: Python3 OS 文件/目录方法 | 菜鸟教程 引入 import os 路径操作 # 获取当前工作目录 current_dir = os.getcwd() print("当前目录:", current_dir) # 切换工作目录(类似 cd 命令) os.chdir("/path/to/new 阅读全文
posted @ 2026-05-18 22:44 giyaYON 阅读(8) 评论(0) 推荐(0)
摘要: 线程进程队列 系统:若干文件运行为多个程序组成 程序:一个或多个进程组成 进程:给该运行程序分配计算机资源 包含一个或多个线程资源 线程:cpu调度的最小单位,真正干活的 并发与并行的区别: 并发:是指系统能够处理多个任务几乎同时发生的能力。在并发中,任务可能实际上是交替执行的,尤其是在单核处理器上 阅读全文
posted @ 2026-05-18 22:37 giyaYON 阅读(6) 评论(0) 推荐(0)
摘要: 安装库 pip install pymongo 更多详情参考: https://chuna2.787528.xyz/heshun/p/10285423.html https://www.runoob.com/python3/python-mongodb.html 使用示例 快速开始 import pym 阅读全文
posted @ 2026-05-18 20:22 giyaYON 阅读(5) 评论(0) 推荐(0)
摘要: 1.监控系统资源 编写脚本来监控CPU、内存、磁盘等系统资源的使用情况。 CPU使用率: 0.8% [状态: NORMAL] 内存使用率: 4.2% [状态: NORMAL] 内存详情: Total: 3.7G | Used: 157M | Free: 2.8G | Available: 3.3G 阅读全文
posted @ 2026-05-18 17:40 giyaYON 阅读(11) 评论(0) 推荐(0)
摘要: 安装 pip install playwright playwright install 使用示例 总体规律是:浏览器-页面-元素选择-操作 from playwright.sync_api import sync_playwright with sync_playwright() as p: br 阅读全文
posted @ 2026-05-17 17:52 giyaYON 阅读(16) 评论(0) 推荐(0)
摘要: 图片下载 import requests headers = { } cookies = {} url = "https://" params = { "w": "640", "h": "427" } response = requests.get(url, headers=headers, coo 阅读全文
posted @ 2026-05-17 01:05 giyaYON 阅读(13) 评论(0) 推荐(0)
摘要: 先引入 pip install PyExecJS 引用 import execjs def encode(value:str): node = execjs.get() with open('api.js', 'r', encoding='utf-8') as f: js_code = f.read 阅读全文
posted @ 2026-05-09 16:59 giyaYON 阅读(2) 评论(0) 推荐(0)
摘要: 1.安装部署 1.新建文件夹 New-Item -ItemType Directory -Force -Path "D:\Projects\container\gitlab\etc", "D:\Projects\container\gitlab\log", "D:\Projects\containe 阅读全文
posted @ 2026-05-08 22:22 giyaYON 阅读(12) 评论(0) 推荐(0)
摘要: 使用协程 Python3.5开始加入async 和await语法,使协程用起来更方便。 def test(t): print(t) run = test(123) 改造一下 import asyncio async def test(t): print(t) run = test(123) prin 阅读全文
posted @ 2026-05-08 14:49 giyaYON 阅读(5) 评论(0) 推荐(0)