当前位置:首页>python>Python非常实用的10个自动化脚本:效率翻倍的秘密武器

Python非常实用的10个自动化脚本:效率翻倍的秘密武器

  • 2026-08-18 23:10:40
Python非常实用的10个自动化脚本:效率翻倍的秘密武器

引言

作为程序员,我们每天都会遇到各种重复繁琐的任务:

  • 手动重命名几十上百个文件
  • 从网页上复制数据到表格
  • 给多人发送相同的邮件
  • 处理Excel数据直到深夜

其实这些任务,用Python几行代码就能搞定!今天整理了10个超实用的自动化脚本,覆盖办公、爬虫、数据处理、系统运维等场景,小白也能直接抄作业!


脚本1:批量重命名文件

适用场景:文件夹里几十个文件要改名,手动改到手酸?

import osimport argparsedef batch_rename_files(folder_path, prefix=”file”, ext=None): ””” 批量重命名文件夹中的文件 Args: folder_path: 文件夹路径 prefix: 新文件名前缀 ext: 筛选指定扩展名(如 ”.txt”) ””” files = os.listdir(folder_path) count = 1 for filename in sorted(files):# 跳过目录 if os.path.isdir(os.path.join(folder_path, filename)): continue# 筛选扩展名 if ext and not filename.endswith(ext): continue# 获取文件扩展名 _, file_ext = os.path.splitext(filename)# 生成新文件名 new_name = f”{prefix}_{count}{file_ext}” old_path = os.path.join(folder_path, filename) new_path = os.path.join(folder_path, new_name) os.rename(old_path, new_path) print(f”重命名: {filename} → {new_name}”) count += 1if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”批量重命名文件”) parser.add_argument(”folder”, help=”目标文件夹路径”) parser.add_argument(”--prefix”, default=”file”, help=”文件名前缀”) parser.add_argument(”--ext”, help=”筛选扩展名(如 .txt)”) args = parser.parse_args() batch_rename_files(args.folder, args.prefix, args.ext)

使用方法

python rename.py ./photos --prefix photo --ext .jpg

脚本2:网页图片批量下载

适用场景:看到喜欢的图片网站,想批量保存所有图片?

import requestsfrom bs4 import BeautifulSoupimport osimport argparsedef download_images(url, save_folder=”downloaded_images”): ””” 批量下载网页中的图片 Args: url: 目标网页URL save_folder: 图片保存目录 ”””# 创建保存目录 os.makedirs(save_folder, exist_ok=True)# 请求网页 headers = { ”User-Agent”: ”Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0 } response = requests.get(url, headers=headers) soup = BeautifulSoup(response.text, ”html.parser”)# 找到所有图片 img_tags = soup.find_all(”img”) count = 1 for img in img_tags: img_url = img.get(”src”) if not img_url: continue# 处理相对路径 if not img_url.startswith(”http”): img_url = requests.compat.urljoin(url, img_url) try:# 下载图片 img_response = requests.get(img_url, headers=headers) img_response.raise_for_status()# 提取文件名 filename = f”image_{count}_{os.path.basename(img_url).split('?')[0]}” save_path = os.path.join(save_folder, filename) with open(save_path, ”wb”) as f: f.write(img_response.content) print(f”下载成功: {filename}”) count += 1 except Exception as e: print(f”下载失败 {img_url}: {e}”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”批量下载网页图片”) parser.add_argument(”url”, help=”目标网页URL”) parser.add_argument(”--folder”, default=”downloaded_images”, help=”保存目录”) args = parser.parse_args() download_images(args.url, args.folder)

使用方法

python download_images.py https://example.com/gallery --folder my_images

脚本3:自动发送邮件(支持附件)

适用场景:每天发报告给老板,或者批量发送通知邮件?

import smtplibfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartfrom email.mime.application import MIMEApplicationimport osimport argparsedef send_email(sender, password, receivers, subject, body, attachments=None): ””” 发送邮件,支持附件 Args: sender: 发件人邮箱 password: 邮箱授权码 receivers: 收件人列表 subject: 邮件主题 body: 邮件正文 attachments: 附件路径列表 ”””# 创建邮件对象 msg = MIMEMultipart() msg[”From”] = sender msg[”To”] = ”, ”.join(receivers) msg[”Subject”] = subject# 添加正文 msg.attach(MIMEText(body, ”plain”, ”utf-8”))# 添加附件 if attachments: for file_path in attachments: if os.path.exists(file_path): with open(file_path, ”rb”) as f: part = MIMEApplication(f.read(), Name=os.path.basename(file_path)) part[”Content-Disposition”] = f'attachment; filename=”{os.path.basename(file_path)}”' msg.attach(part) print(f”添加附件: {file_path}”)# 发送邮件 try: with smtplib.SMTP_SSL(”smtp.qq.com”, 465as server: server.login(sender, password) server.sendmail(sender, receivers, msg.as_string()) print(”邮件发送成功!”) except Exception as e: print(f”邮件发送失败: {e}”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”发送邮件”) parser.add_argument(”--sender”, required=Truehelp=”发件人邮箱”) parser.add_argument(”--password”, required=Truehelp=”邮箱授权码”) parser.add_argument(”--to”, required=True, nargs=”+”, help=”收件人邮箱”) parser.add_argument(”--subject”, required=Truehelp=”邮件主题”) parser.add_argument(”--body”, required=Truehelp=”邮件正文”) parser.add_argument(”--attach”, nargs=”+”, help=”附件路径”) args = parser.parse_args() send_email(args.sender, args.password, args.to, args.subject, args.body, args.attach)

使用方法

python send_email.py --sender xxx@qq.com --password your_auth_code \ --to boss@company.com colleague@company.com \ --subject ”周报” --body ”这是本周的工作汇报” \ --attach report.xlsx chart.png

脚本4:Excel数据处理与分析

适用场景:Excel几百行数据,手动计算、筛选、汇总太累?

import pandas as pdimport argparsedef excel_processor(input_file, output_file=None): ””” Excel数据处理工具 功能: 1. 读取Excel文件 2. 数据清洗(去除空值) 3. 数据统计 4. 添加计算列 5. 导出结果 ”””# 读取Excel df = pd.read_excel(input_file) print(f”原始数据形状: {df.shape}”) print(”\n数据预览:”) print(df.head())# 数据清洗 original_rows = len(df) df = df.dropna() print(f”\n去除空值后: {len(df)} 行(删除 {original_rows - len(df)} 行)”)# 数据统计 print(”\n数据统计:”) print(df.describe())# 如果有数值列,添加计算列示例 numeric_cols = df.select_dtypes(include=['int64''float64']).columns if len(numeric_cols) >= 2: df[”合计”] = df[numeric_cols].sum(axis=1) print(f”\n添加'合计'列完成”)# 导出结果 if not output_file: output_file = input_file.replace(”.xlsx”, ”_processed.xlsx”) df.to_excel(output_file, index=False) print(f”\n处理完成!结果已保存到: {output_file}”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”Excel数据处理”) parser.add_argument(”input”, help=”输入Excel文件”) parser.add_argument(”--output”, help=”输出文件路径”) args = parser.parse_args() excel_processor(args.input, args.output)

使用方法

python excel_processor.py data.xlsx --output result.xlsx

脚本5:批量压缩图片

适用场景:照片太多占空间?批量压缩节省存储空间!

from PIL import Imageimport osimport argparsedef compress_images(input_folder, output_folder=None, max_size=(19201080), quality=85): ””” 批量压缩图片 Args: input_folder: 输入图片目录 output_folder: 输出目录(默认在原目录下创建compressed子目录) max_size: 最大尺寸(宽, 高) quality: 压缩质量(1-100 ””” if not output_folder: output_folder = os.path.join(input_folder, ”compressed”) os.makedirs(output_folder, exist_ok=True) supported_extensions = (”.jpg”, ”.jpeg”, ”.png”, ”.bmp”, ”.gif”) count = 0 total_size = 0 saved_size = 0 for filename in os.listdir(input_folder): if not filename.lower().endswith(supported_extensions): continue input_path = os.path.join(input_folder, filename) if os.path.isdir(input_path): continue try:# 打开图片 img = Image.open(input_path)# 计算原大小 original_size = os.path.getsize(input_path) total_size += original_size# 调整尺寸(保持比例) img.thumbnail(max_size)# 保存压缩后的图片 output_path = os.path.join(output_folder, filename) img.save(output_path, quality=quality)# 计算节省的空间 compressed_size = os.path.getsize(output_path) saved_size += (original_size - compressed_size) print(f”压缩成功: {filename} ({original_size/1024:.1f}KB → {compressed_size/1024:.1f}KB)”) count += 1 except Exception as e: print(f”压缩失败 {filename}: {e}”) print(f”\n压缩完成!共处理 {count} 张图片”) print(f”原始总大小: {total_size/1024/1024:.2f} MB”) print(f”节省空间: {saved_size/1024/1024:.2f} MB”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”批量压缩图片”) parser.add_argument(”folder”, help=”图片文件夹路径”) parser.add_argument(”--output”, help=”输出目录”) parser.add_argument(”--max-width”, type=int, default=1920help=”最大宽度”) parser.add_argument(”--max-height”, type=int, default=1080help=”最大高度”) parser.add_argument(”--quality”, type=int, default=85help=”压缩质量(1-100)”) args = parser.parse_args() compress_images(args.folder, args.output, (args.max_width, args.max_height), args.quality)

使用方法

python compress_images.py ./photos --max-width 1200 --max-height 800 --quality 80

脚本6:生成强密码

适用场景:注册账号总想不到复杂密码?一键生成!

import randomimport stringimport argparsedef generate_password(length=12, include_uppercase=True, include_lowercase=True, include_digits=True, include_symbols=True, exclude_chars=””): ””” 生成强密码 Args: length: 密码长度 include_uppercase: 是否包含大写字母 include_lowercase: 是否包含小写字母 include_digits: 是否包含数字 include_symbols: 是否包含符号 exclude_chars: 需要排除的字符 ”””# 构建字符池 chars = ”” if include_uppercase: chars += string.ascii_uppercase if include_lowercase: chars += string.ascii_lowercase if include_digits: chars += string.digits if include_symbols: chars += string.punctuation# 排除指定字符 chars = ''.join(c for c in chars if c not in exclude_chars) if not chars: raise ValueError(”没有可用的字符集!”)# 确保包含每种类型至少一个字符 password = [] if include_uppercase: password.append(random.choice(string.ascii_uppercase)) if include_lowercase: password.append(random.choice(string.ascii_lowercase)) if include_digits: password.append(random.choice(string.digits)) if include_symbols: password.append(random.choice(string.punctuation))# 填充剩余长度 for _ in range(length - len(password)): password.append(random.choice(chars))# 打乱顺序 random.shuffle(password) return ''.join(password)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”生成强密码”) parser.add_argument(”--length”, type=int, default=12help=”密码长度”) parser.add_argument(”--count”, type=int, default=1help=”生成数量”) parser.add_argument(”--no-uppercase”, action=”store_true”, help=”不包含大写字母”) parser.add_argument(”--no-lowercase”, action=”store_true”, help=”不包含小写字母”) parser.add_argument(”--no-digits”, action=”store_true”, help=”不包含数字”) parser.add_argument(”--no-symbols”, action=”store_true”, help=”不包含符号”) parser.add_argument(”--exclude”, default=””, help=”排除的字符”) args = parser.parse_args() for i in range(args.count): password = generate_password( length=args.length, include_uppercase=not args.no_uppercase, include_lowercase=not args.no_lowercase, include_digits=not args.no_digits, include_symbols=not args.no_symbols, exclude_chars=args.exclude ) print(f”密码 {i+1}: {password}”)

使用方法

python generate_password.py --length 16 --count 5 --exclude ”\”'”

脚本7:PDF合并与拆分

适用场景:多个PDF想合成一个,或者一个大PDF想拆分成多个?

from PyPDF2 import PdfMerger, PdfReader, PdfWriterimport osimport argparsedef merge_pdfs(input_files, output_file=”merged.pdf”): ”””合并多个PDF文件””” merger = PdfMerger() for pdf_file in input_files: if os.path.exists(pdf_file): merger.append(pdf_file) print(f”添加: {pdf_file}”) merger.write(output_file) merger.close() print(f”\n合并完成!保存到: {output_file}”)def split_pdf(input_file, pages_per_file=10): ”””拆分PDF文件””” reader = PdfReader(input_file) total_pages = len(reader.pages) base_name = os.path.splitext(input_file)[0] for i in range(0, total_pages, pages_per_file): writer = PdfWriter() end_page = min(i + pages_per_file, total_pages) for j in range(i, end_page): writer.add_page(reader.pages[j]) output_file = f”{base_name}_part_{i//pages_per_file + 1}.pdf” with open(output_file, ”wb”) as f: writer.write(f) print(f”生成: {output_file} (第 {i+1}-{end_page} 页)”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”PDF处理工具”) subparsers = parser.add_subparsers(dest=”command”, required=True)# 合并命令 merge_parser = subparsers.add_parser(”merge”, help=”合并PDF”) merge_parser.add_argument(”files”, nargs=”+”, help=”要合并的PDF文件”) merge_parser.add_argument(”--output”, default=”merged.pdf”, help=”输出文件”)# 拆分命令 split_parser = subparsers.add_parser(”split”, help=”拆分PDF”) split_parser.add_argument(”file”, help=”要拆分的PDF文件”) split_parser.add_argument(”--pages”, type=int, default=10help=”每文件页数”) args = parser.parse_args() if args.command == ”merge”: merge_pdfs(args.files, args.output) elif args.command == ”split”: split_pdf(args.file, args.pages)

使用方法

# 合并PDFpython pdf_tool.py merge file1.pdf file2.pdf --output combined.pdf# 拆分PDF(每10页一个文件)python pdf_tool.py split big_file.pdf --pages 10

脚本8:网络速度测试

适用场景:想知道自己的网速?自动测试上传下载速度!

import speedtestimport argparsedef test_speed(server_id=None): ””” 测试网络速度 Args: server_id: 指定服务器ID(可选) ””” print(”正在初始化测速工具...”) st = speedtest.Speedtest()# 获取服务器列表 print(”正在获取服务器列表...”) servers = st.get_servers() if server_id: st.get_best_server([server_id]) else: st.get_best_server() print(f”选择的服务器: {st.results.server['name']} ({st.results.server['country']})”)# 测试下载速度 print(”正在测试下载速度...”) download_speed = st.download() / 1_000_000# 转为Mbps# 测试上传速度 print(”正在测试上传速度...”) upload_speed = st.upload() / 1_000_000# 转为Mbps# 获取延迟 ping = st.results.ping# 输出结果 print(”\n” + ”=” * 40) print(f”下载速度: {download_speed:.2f} Mbps”) print(f”上传速度: {upload_speed:.2f} Mbps”) print(f”延迟: {ping:.2f} ms”) print(”=” * 40)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”网络速度测试”) parser.add_argument(”--server”, type=inthelp=”指定服务器ID”) args = parser.parse_args() test_speed(args.server)

使用方法

python speed_test.py

脚本9:系统资源监控

适用场景:电脑CPU发烫怕死机?实时监控系统资源!

import psutilimport timeimport argparsedef monitor_system(interval=2, duration=60): ””” 监控系统资源 Args: interval: 监控间隔(秒) duration: 总监控时长(秒) ””” print(f”开始监控系统资源(间隔 {interval} 秒,时长 {duration} 秒)”) print(”=” * 70) print(f”{'时间':<10} {'CPU%':<8} {'内存%':<8} {'磁盘%':<8} {'网络(MB/s)':<15}”) print(”=” * 70) end_time = time.time() + duration last_net_io = psutil.net_io_counters() while time.time() < end_time:# CPU使用率 cpu_percent = psutil.cpu_percent()# 内存使用率 mem = psutil.virtual_memory() mem_percent = mem.percent# 磁盘使用率(根目录) disk = psutil.disk_usage('/') disk_percent = disk.percent# 网络速度 current_net_io = psutil.net_io_counters() net_speed = (current_net_io.bytes_sent + current_net_io.bytes_recv -  last_net_io.bytes_sent - last_net_io.bytes_recv) / 1024 / 1024 / interval last_net_io = current_net_io# 当前时间 current_time = time.strftime(”%H:%M:%S”)# 输出 print(f”{current_time:<10} {cpu_percent:<8.1f} {mem_percent:<8.1f} {disk_percent:<8.1f} {net_speed:<15.2f}”) time.sleep(interval) print(”=” * 70) print(”监控结束!”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”系统资源监控”) parser.add_argument(”--interval”, type=int, default=2help=”监控间隔(秒)”) parser.add_argument(”--duration”, type=int, default=60help=”监控时长(秒)”) args = parser.parse_args() monitor_system(args.interval, args.duration)

使用方法

python system_monitor.py --interval 1 --duration 30

脚本10:批量删除重复文件

适用场景:文件夹里有很多重复文件?自动识别并删除!

import osimport hashlibfrom collections import defaultdictimport argparsedef get_file_hash(file_path): ”””计算文件的MD5哈希值””” hash_md5 = hashlib.md5() with open(file_path, ”rb”) as f: for chunk in iter(lambda: f.read(8192), b””): hash_md5.update(chunk) return hash_md5.hexdigest()def find_duplicate_files(folder_path, min_size=0): ””” 查找重复文件 Args: folder_path: 目标文件夹 min_size: 最小文件大小(字节),小于此值的文件跳过 ””” hash_map = defaultdict(list) for root, dirs, files in os.walk(folder_path): for filename in files: file_path = os.path.join(root, filename)# 跳过太小的文件 if os.path.getsize(file_path) < min_size: continue try: file_hash = get_file_hash(file_path) hash_map[file_hash].append(file_path) except Exception as e: print(f”读取文件失败 {file_path}: {e}”)# 找出重复文件(哈希值对应多个文件) duplicates = {k: v for k, v in hash_map.items() if len(v) > 1} return duplicatesdef delete_duplicates(folder_path, min_size=0, dry_run=True): ””” 删除重复文件 Args: folder_path: 目标文件夹 min_size: 最小文件大小 dry_run: 模拟运行,不实际删除 ””” duplicates = find_duplicate_files(folder_path, min_size) if not duplicates: print(”没有找到重复文件!”) return print(f”找到 {len(duplicates)} 组重复文件:”) print(”=” * 60) total_deleted = 0 total_saved = 0 for file_hash, file_list in duplicates.items(): print(f”\n重复组 ({file_hash[:8]}...):”) for i, file_path in enumerate(file_list): size = os.path.getsize(file_path) if i == 0: print(f” 保留: {file_path} ({size/1024/1024:.2f} MB)”) else: print(f” 删除: {file_path} ({size/1024/1024:.2f} MB)”) if not dry_run: try: os.remove(file_path) total_deleted += 1 total_saved += size except Exception as e: print(f” 删除失败: {e}”) print(”\n” + ”=” * 60) if dry_run: print(f”模拟完成!将删除 {total_deleted} 个文件,节省 {total_saved/1024/1024:.2f} MB 空间”) print(”使用 --no-dry-run 实际删除”) else: print(f”删除完成!共删除 {total_deleted} 个文件,节省 {total_saved/1024/1024:.2f} MB 空间”)if __name__ == ”__main__”: parser = argparse.ArgumentParser(description=”删除重复文件”) parser.add_argument(”folder”, help=”目标文件夹”) parser.add_argument(”--min-size”, type=int, default=0help=”最小文件大小(字节)”) parser.add_argument(”--no-dry-run”, action=”store_true”, help=”实际删除文件”) args = parser.parse_args() delete_duplicates(args.folder, args.min_size, not args.no_dry_run)

使用方法

# 先模拟(不实际删除)python delete_duplicates.py ./documents --min-size 1024# 实际删除python delete_duplicates.py ./documents --no-dry-run

使用说明

安装依赖

pip install requests beautifulsoup4 pandas openpyxl Pillow PyPDF2 speedtest-cli psutil

脚本特点


结语

这10个自动化脚本覆盖了日常工作生活中的大部分场景,希望能帮你节省时间、提高效率!

核心思想:Python的强大之处在于它丰富的第三方库,几乎任何重复任务都能找到对应的库来解决。学会用自动化脚本武装自己,让计算机替你干活!

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-08-21 21:28:50 HTTP/2.0 GET : https://f.mffb.com.cn/a/505314.html
  2. 运行时间 : 0.725283s [ 吞吐率:1.38req/s ] 内存消耗:4,983.82kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=9a6ec4e8b1a03a4acaec0075a2b601ef
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000933s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001652s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000630s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.014999s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001738s ]
  6. SELECT * FROM `set` [ RunTime:0.041144s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001582s ]
  8. SELECT * FROM `article` WHERE `id` = 505314 LIMIT 1 [ RunTime:0.011702s ]
  9. UPDATE `article` SET `lasttime` = 1787318931 WHERE `id` = 505314 [ RunTime:0.002300s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000684s ]
  11. SELECT * FROM `article` WHERE `id` < 505314 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.053958s ]
  12. SELECT * FROM `article` WHERE `id` > 505314 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.013591s ]
  13. SELECT * FROM `article` WHERE `id` < 505314 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.195998s ]
  14. SELECT * FROM `article` WHERE `id` < 505314 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.159320s ]
  15. SELECT * FROM `article` WHERE `id` < 505314 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.045035s ]
0.728890s