当前位置:首页>python>Python模块教程:difflib文本差异化比较

Python模块教程:difflib文本差异化比较

  • 2026-04-16 02:00:41
Python模块教程:difflib文本差异化比较

Python,速成心法

敲代码,查资料,问度娘

练习,探索,总结,优化

博文创作不易,我的博文不需要打赏,也不需要知识付费,可以白嫖学习编程小技巧。使用代码的过程中,如有疑问的地方,欢迎大家指正留言交流。喜欢的老铁可以多多点赞+收藏分享+置顶,小红牛在此表示感谢。

Tkinter教程40:(鼠标,键盘等)事件处理综合示例
Tkinter教程39:常用tk组件综合示例,3分钟带你速学速成,安排 !!
Matplotlib教程07:mplcursors也能实现,鼠标悬停交互显示
Python爬虫教程30:Selenium网页元素,定位的8种方法!
Python教程94:jieba模块用法(分词模式+自定义词典+提取词性+关键字),一个优秀的中文分词库。
Python入门教程11:time模块的示例用法
Python入门教程10:datetime模块的示例用法
Python入门教程21:os模块的示例用法
Python教程91:关于海龟画图,Turtle模块需要学习的知识点
difflib 是 Python 标准库中用于比较序列(尤其是文本行)差异的模块。它提供了一系列工具,能够计算相似度、生成差异报告,并以多种格式展示结果,非常适合用于构建版本对比、代码审查或文本比较工具。
行差异(ndiff):逐行比较,用 -、+、? 等符号标记差异,并带颜色高亮。
统一差异(unified_diff):显示标准的 diff -u 格式。
相似度比率:基于 SequenceMatcher 计算两个文本的相似度百分比。
此外,还可以将 HtmlDiff 生成的 HTML 报告保存到临时文件并用浏览器打开(作为扩展功能)。

↓ 源码如下 ↓

# -*- coding: utf-8 -*-# @Author : 小红牛# 微信公众号:wdPythonimport tkinter as tkfrom tkinter import filedialog, scrolledtext, messageboximport difflibimport tempfileimport webbrowserimport osclass DiffViewerApp:    def __init__(self, root):        self.root = root        self.root.title("difflib模块 综合示例 - 文本差异比较器")        self.root.geometry("1000x700")        # 创建主框架        main_frame = tk.Frame(root)        main_frame.pack(fill=tk.BOTH, expand=True, padx=5, pady=5)        # 左侧文本区域        left_frame = tk.LabelFrame(main_frame, text="原始文本 (A)", padx=5, pady=5)        left_frame.grid(row=0, column=0, sticky="nsew", padx=5, pady=5)        self.text_left = scrolledtext.ScrolledText(left_frame, wrap=tk.NONE, font=("Consolas"10))        self.text_left.pack(fill=tk.BOTH, expand=True)        btn_left_load = tk.Button(left_frame, text="加载文件", command=lambdaself.load_file(self.text_left))        btn_left_load.pack(pady=2)        # 右侧文本区域        right_frame = tk.LabelFrame(main_frame, text="修改后文本 (B)", padx=5, pady=5)        right_frame.grid(row=0, column=1, sticky="nsew", padx=5, pady=5)        self.text_right = scrolledtext.ScrolledText(right_frame, wrap=tk.NONE, font=("Consolas"10))        self.text_right.pack(fill=tk.BOTH, expand=True)        btn_right_load = tk.Button(right_frame, text="加载文件", command=lambdaself.load_file(self.text_right))        btn_right_load.pack(pady=2)        # 控制面板        control_frame = tk.Frame(main_frame)        control_frame.grid(row=1, column=0, columnspan=2, sticky="ew", pady=10)        self.mode_var = tk.StringVar(value="ndiff")        mode_ndiff = tk.Radiobutton(control_frame, text="行差异 (ndiff)", variable=self.mode_var, value="ndiff")        mode_unified = tk.Radiobutton(control_frame, text="统一差异 (unified_diff)", variable=self.mode_var, value="unified")        mode_ratio = tk.Radiobutton(control_frame, text="相似度比率", variable=self.mode_var, value="ratio")        mode_ndiff.pack(side=tk.LEFT, padx=5)        mode_unified.pack(side=tk.LEFT, padx=5)        mode_ratio.pack(side=tk.LEFT, padx=5)        btn_compare = tk.Button(control_frame, text="比较", command=self.compare_texts, bg="#4CAF50", fg="white")        btn_compare.pack(side=tk.LEFT, padx=20)        btn_clear = tk.Button(control_frame, text="清空所有", command=self.clear_all, bg="#f44336", fg="white")        btn_clear.pack(side=tk.LEFT, padx=5)        # 新增:加载示例按钮        #btn_example = tk.Button(control_frame, text="加载示例", command=self.load_example, bg="#FF9800", fg="white")        #btn_example.pack(side=tk.LEFT, padx=5)        # 扩展功能:生成 HTML 差异报告        btn_html = tk.Button(control_frame, text="生成 HTML 差异报告 (浏览器打开)", command=self.generate_html_diff, bg="#2196F3", fg="white")        btn_html.pack(side=tk.LEFT, padx=5)        # 结果显示区域        result_frame = tk.LabelFrame(main_frame, text="比较结果", padx=5, pady=5)        result_frame.grid(row=2, column=0, columnspan=2, sticky="nsew", padx=5, pady=5)        self.text_result = scrolledtext.ScrolledText(result_frame, wrap=tk.NONE, font=("Consolas"10))        self.text_result.pack(fill=tk.BOTH, expand=True)        # 配置网格权重,使窗口自适应        main_frame.grid_rowconfigure(0, weight=1)        main_frame.grid_rowconfigure(2, weight=1)        main_frame.grid_columnconfigure(0, weight=1)        main_frame.grid_columnconfigure(1, weight=1)        # 配置差异结果的颜色标签        self.text_result.tag_config("add", foreground="green", background="#e8f5e9")        self.text_result.tag_config("delete", foreground="red", background="#ffebee")        self.text_result.tag_config("change", foreground="blue", background="#e3f2fd")        self.text_result.tag_config("info", foreground="gray", font=("Consolas"9"italic"))        # 加载示例文件        self.load_example()    def load_file(self, text_widget):        """加载文本文件到指定的 Text 组件"""        filepath = filedialog.askopenfilename(            title="选择文本文件",            filetypes=[("文本文件""*.txt"), ("所有文件""*.*")]        )        if not filepath:            return        try:            with open(filepath, "r", encoding="utf-8"as f:                content = f.read()            text_widget.delete(1.0, tk.END)            text_widget.insert(1.0, content)        except Exception as e:            messagebox.showerror("错误"f"无法读取文件:{e}")    def get_text(self, text_widget):        """从 Text 组件获取文本(按行分割)"""        return text_widget.get(1.0, tk.END).rstrip("\n")    def clear_all(self):        """清空所有文本框"""        self.text_left.delete(1.0, tk.END)        self.text_right.delete(1.0, tk.END)        self.text_result.delete(1.0, tk.END)    def load_example(self):        """加载预定义的示例文本,展示各种差异类型"""        example_left = """我是李白Hello world!This is a simple example.We have a line that will be removed.Another line to demonstrate word changes.Line with numbers: 12345.Final line stays the same."""        example_right = """我是杜甫Hello Python!This is a simple example.Another line to demonstrate word changes. (modified)Line with numbers: 12345 and more.Final line stays the same.Brand new line added at the end."""        self.text_left.delete(1.0, tk.END)        self.text_left.insert(1.0, example_left)        self.text_right.delete(1.0, tk.END)        self.text_right.insert(1.0, example_right)        self.text_result.delete(1.0, tk.END)        messagebox.showinfo("示例已加载""左右两侧已填充示例文本。\n\n包含以下差异:\n- 首行单词变化\n- 中间一行被删除\n- 某行被修改并添加注释\n- 数字序列扩展\n- 末尾新增一行")    def compare_texts(self):        """根据选择的模式执行比较"""        text_a = self.get_text(self.text_left)        text_b = self.get_text(self.text_right)        if not text_a and not text_b:            messagebox.showinfo("提示""请在两侧输入文本或加载文件。")            return        mode = self.mode_var.get()        self.text_result.delete(1.0, tk.END)        if mode == "ndiff":            self.show_ndiff(text_a, text_b)        elif mode == "unified":            self.show_unified_diff(text_a, text_b)        elif mode == "ratio":            self.show_ratio(text_a, text_b)    def show_ndiff(self, text_a, text_b):        """使用 difflib.ndiff 显示带颜色标记的行差异"""        a_lines = text_a.splitlines()        b_lines = text_b.splitlines()        diff = difflib.ndiff(a_lines, b_lines)        for line in diff:            if line.startswith('- '):                self.text_result.insert(tk.END, line + "\n""delete")            elif line.startswith('+ '):                self.text_result.insert(tk.END, line + "\n""add")            elif line.startswith('? '):                self.text_result.insert(tk.END, line + "\n""change")            else:                self.text_result.insert(tk.END, line + "\n")    def show_unified_diff(self, text_a, text_b):        """显示统一差异格式(类似 diff -u)"""        a_lines = text_a.splitlines()        b_lines = text_b.splitlines()        # 可以自定义上下文行数,这里设为3        diff = difflib.unified_diff(a_lines, b_lines, fromfile='原始文本', tofile='修改后文本', lineterm='')        diff_text = "\n".join(diff)        if not diff_text.strip():            self.text_result.insert(tk.END, "两个文本完全相同,没有差异。""info")        else:            # 统一差异中,以 + 和 - 开头的行分别标记            for line in diff_text.splitlines():                if line.startswith('+'):                    self.text_result.insert(tk.END, line + "\n""add")                elif line.startswith('-'):                    self.text_result.insert(tk.END, line + "\n""delete")                elif line.startswith('@@'):                    self.text_result.insert(tk.END, line + "\n""change")                else:                    self.text_result.insert(tk.END, line + "\n")    def show_ratio(self, text_a, text_b):        """计算相似度比率并显示"""        seq_matcher = difflib.SequenceMatcher(None, text_a, text_b)        ratio = seq_matcher.ratio()        quick_ratio = seq_matcher.quick_ratio()        real_quick_ratio = seq_matcher.real_quick_ratio()        result = (            f"相似度分析结果(0~1,越接近1越相似):\n\n"            f"ratio() ............ {ratio:.4f}\n"            f"quick_ratio() ...... {quick_ratio:.4f}\n"            f"real_quick_ratio() . {real_quick_ratio:.4f}\n\n"            f"说明:\n"            f"- ratio: 基本相似度,考虑所有字符\n"            f"- quick_ratio: 快速近似计算\n"            f"- real_quick_ratio: 最快但最粗略的估算"        )        self.text_result.insert(tk.END, result, "info")    def generate_html_diff(self):        """使用 HtmlDiff 生成 HTML 报告并在默认浏览器中打开"""        text_a = self.get_text(self.text_left)        text_b = self.get_text(self.text_right)        if not text_a and not text_b:            messagebox.showinfo("提示""请在两侧输入文本或加载文件。")            return        a_lines = text_a.splitlines()        b_lines = text_b.splitlines()        htmldiff = difflib.HtmlDiff()        # 生成完整的 HTML 页面,上下文行数设为3        html_content = htmldiff.make_file(a_lines, b_lines, fromdesc='原始文本', todesc='修改后文本', context=True, numlines=3)        # 保存到临时文件并打开        try:            with tempfile.NamedTemporaryFile(mode='w', suffix='.html', delete=False, encoding='utf-8'as f:                f.write(html_content)                temp_path = f.name            webbrowser.open('file://' + temp_path)            # 注意:临时文件不会自动删除,可以在程序关闭时清理,但为了简单起见这里不做处理        except Exception as e:            messagebox.showerror("错误"f"生成 HTML 报告失败:{e}")if __name__ == "__main__":    root = tk.Tk()    app = DiffViewerApp(root)    root.mainloop()

完毕!!感谢您的收看

--------★历史博文集合★--------

Python入门篇  进阶篇  视频教程  Py安装

py项目Python模块 Python爬虫  Json

Xpath正则表达式SeleniumEtreeCss

Gui程序开发TkinterPyqt5 列表元组字典

数据可视化 matplotlib词云图Pyecharts

海龟画图PandasBug处理电脑小知识

自动化脚本编程工具NumPy CSVWeb

Pygame  图像处理    机器学习数据库

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-16 02:46:57 HTTP/2.0 GET : https://f.mffb.com.cn/a/485928.html
  2. 运行时间 : 0.093822s [ 吞吐率:10.66req/s ] 内存消耗:4,669.45kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=0a9c2b6e8ce222e6a9f2ad443c8b3979
  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.000418s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000764s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000341s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000297s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000490s ]
  6. SELECT * FROM `set` [ RunTime:0.000195s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000575s ]
  8. SELECT * FROM `article` WHERE `id` = 485928 LIMIT 1 [ RunTime:0.008735s ]
  9. UPDATE `article` SET `lasttime` = 1776278817 WHERE `id` = 485928 [ RunTime:0.007909s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000276s ]
  11. SELECT * FROM `article` WHERE `id` < 485928 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000503s ]
  12. SELECT * FROM `article` WHERE `id` > 485928 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000391s ]
  13. SELECT * FROM `article` WHERE `id` < 485928 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001387s ]
  14. SELECT * FROM `article` WHERE `id` < 485928 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001693s ]
  15. SELECT * FROM `article` WHERE `id` < 485928 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001962s ]
0.095464s