分类: 分类文章

12 篇文章

thumbnail
python常用代码片段
基本文件读写 with open('file.txt', 'w') as f: f.write('Hello, World!') with open('file.txt', 'r') as f: content = f.read() 路径处理 import os from pathlib import Path file_path = os.pat…
thumbnail
弹窗文案(python)
import tkinter as tk import random # 弹窗计数器(初始为0) window_count = 0 # 最大弹窗数量 MAX_WINDOWS = 300 def create_warm_tip(): global window_count # 声明使用全局计数器 # 创建弹窗(关联主窗口 root) window =…