当前位置:首页>python>Python Tkinter第三方库融合:把matplotlib、PIL等塞进窗口的正确姿势

Python Tkinter第三方库融合:把matplotlib、PIL等塞进窗口的正确姿势

  • 2026-06-29 06:50:46
Python Tkinter第三方库融合:把matplotlib、PIL等塞进窗口的正确姿势

📊 一张图表,难倒了多少Tkinter开发者

做数据展示类的桌面工具,早晚会遇到这个坎——用户要看图表。折线图、柱状图、实时曲线,这些东西Tkinter自带的Canvas画起来费劲,效果还不好看。自然而然就想到了matplotlib。但一搜怎么嵌入,发现网上的例子要么过时,要么跑起来窗口一闪而过,要么图表和界面完全对不上号。

不只是matplotlib。PIL/Pillow处理图片显示、ttkbootstrap美化界面、pyqtgraph做高性能实时曲线——这些第三方库各有各的渲染机制,跟Tkinter的主循环整合起来,坑比想象的多。

这篇文章把这几个最常用的融合场景逐一拆解,从原理到代码,每段示例都在Windows环境下验证过。


🔬 先搞懂一件事:为什么嵌入会出问题

Tkinter有自己的事件循环(mainloop()),matplotlib有自己的渲染后端,PIL有自己的图像对象体系。把它们揉在一起,本质上是在让三个各自为政的系统协同工作。

问题的根源,几乎都指向同一个地方:渲染时机和主线程的控制权争夺。matplotlib默认用独立窗口显示图表(plt.show() 会阻塞主线程),PIL的 Image 对象不能直接贴到Tkinter控件上,这些都需要用特定的桥接方式绕过去。

知道了根源,解法就清晰了——用各个库提供的"嵌入模式"接口,把渲染权交还给Tkinter主循环来统一调度。


📈 融合一:matplotlib静态图表嵌入

这是最高频的需求。报表工具、数据分析小程序,基本都要用到。

import tkinter as tk  
from tkinter import ttk  
import matplotlib  

matplotlib.use('TkAgg')  # 关键:必须在import pyplot之前设置后端  

import matplotlib.pyplot as plt  
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk  
from matplotlib.figure import Figure  
import numpy as np  


classStaticChartPanel(tk.Frame):  
"""  
    静态图表面板  
    可作为独立组件嵌入任意Tkinter布局  
    """

def__init__(self, parent, figsize=(84), dpi=100, **kwargs):  
super().__init__(parent, **kwargs)  

        plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']  # Windows下显示中文  
        plt.rcParams['axes.unicode_minus'] = False

# 创建matplotlib Figure对象,不通过plt接口  
# 直接用Figure而不是plt.figure(),避免全局状态污染  
self.fig = Figure(figsize=figsize, dpi=dpi, facecolor='
#f8f9fa')  
self.ax = self.fig.add_subplot(111)  

# FigureCanvasTkAgg 是连接matplotlib和Tkinter的核心桥梁  
self.canvas = FigureCanvasTkAgg(self.fig, master=self)  
self.canvas_widget = self.canvas.get_tk_widget()  
self.canvas_widget.pack(fill='both', expand=True)  

# 可选:加上matplotlib自带的工具栏(缩放、平移、保存)  
self.toolbar = NavigationToolbar2Tk(self.canvas, self)  
self.toolbar.update()  

# 初始化一个空图表  
self._draw_empty()  

def_draw_empty(self):  
self.ax.set_facecolor('#ffffff')  
self.ax.text(  
0.50.5'暂无数据',  
            transform=self.ax.transAxes,  
            ha='center', va='center',  
            fontsize=14, color='#cccccc',  
            fontproperties='Microsoft YaHei'# Windows下中文字体  
        )  
self.canvas.draw()  

defplot_line(self, x_data, y_data, title='', xlabel='', ylabel='', color='#1976d2'):  
"""绘制折线图,外部调用这个方法更新图表内容"""
self.ax.clear()  
self.ax.plot(x_data, y_data, color=color, linewidth=2, marker='o', markersize=4)  

# 样式设置  
self.ax.set_title(title, fontproperties='Microsoft YaHei', fontsize=13, pad=10)  
self.ax.set_xlabel(xlabel, fontproperties='Microsoft YaHei')  
self.ax.set_ylabel(ylabel, fontproperties='Microsoft YaHei')  
self.ax.grid(True, alpha=0.3, linestyle='--')  
self.ax.set_facecolor('#fafafa')  
self.fig.tight_layout()  

# draw() 触发重绘,必须显式调用  
self.canvas.draw()  

defplot_bar(self, categories, values, title='', color='#42a5f5'):  
"""绘制柱状图"""
self.ax.clear()  
        bars = self.ax.bar(categories, values, color=color, alpha=0.85, width=0.6)  

# 在柱子顶部标注数值  
for bar, val inzip(bars, values):  
self.ax.text(  
                bar.get_x() + bar.get_width() / 2,  
                bar.get_height() + max(values) * 0.01,  
f'{val:.1f}',  
                ha='center', va='bottom', fontsize=9
            )  

self.ax.set_title(title, fontproperties='Microsoft YaHei', fontsize=13)  
self.ax.set_facecolor('#fafafa')  
self.fig.tight_layout()  
self.canvas.draw()  


# --- 完整使用示例 ---class ReportWindow:  

def__init__(self):  
self.root = tk.Tk()  
self.root.title('销售数据报表')  
self.root.geometry('900x600')  

self._build_ui()  
self._load_sample_data()  

def_build_ui(self):  
# 左侧控制面板  
        ctrl_frame = tk.Frame(self.root, width=160, bg='#eceff1')  
        ctrl_frame.pack(side='left', fill='y', padx=0)  
        ctrl_frame.pack_propagate(False)  

        tk.Label(ctrl_frame, text='图表类型', bg='#eceff1',  
                 font=('微软雅黑'11'bold')).pack(pady=(208))  

self.chart_type = tk.StringVar(value='line')  
for text, val in [('折线图''line'), ('柱状图''bar')]:  
            tk.Radiobutton(  
                ctrl_frame, text=text, variable=self.chart_type,  
                value=val, bg='#eceff1', font=('微软雅黑'10),  
                command=self._refresh_chart  
            ).pack(anchor='w', padx=20)  

# 右侧图表区域  
        chart_frame = tk.Frame(self.root)  
        chart_frame.pack(side='right', fill='both', expand=True, padx=10, pady=10)  

self.chart = StaticChartPanel(chart_frame, figsize=(74.5))  
self.chart.pack(fill='both', expand=True)  

def_load_sample_data(self):  
self.months = ['1月''2月''3月''4月''5月''6月']  
self.sales = [42.358.151.767.473.269.8]  
self._refresh_chart()  

def_refresh_chart(self):  
ifself.chart_type.get() == 'line':  
self.chart.plot_line(  
self.months, self.sales,  
                title='2025年上半年销售额(万元)',  
                xlabel='月份', ylabel='销售额'
            )  
else:  
self.chart.plot_bar(  
self.months, self.sales,  
                title='2025年上半年销售额(万元)'
            )  

defrun(self):  
self.root.mainloop()  

if __name__ == '__main__':  
    ReportWindow().run()

这里有个细节很多人会踩——matplotlib.use('TkAgg')必须在 import matplotlib.pyplot 之前调用,否则后端已经初始化完了,再改就不生效了,还不报错,只是图表显示异常。这个坑我在一个项目里排查了大半天才找到。


⚡ 融合二:matplotlib实时动态曲线

静态图表好说,实时刷新的曲线才是真正的挑战。工控监控、传感器数据可视化、网络流量图——这类场景要求图表每隔几百毫秒更新一次,同时界面其他部分还得正常响应操作。

import collections  
import time  
import threading  
import random  
import tkinter as tk  
from tkinter import ttk  
import matplotlib  
import matplotlib.pyplot as plt  
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk  
from matplotlib.figure import Figure  
import numpy as np  

classRealtimeChartPanel(tk.Frame):  
"""  
    实时滚动曲线面板  
    使用 deque 作为环形缓冲区,避免列表无限增长  
    """

def__init__(self, parent, max_points=100, update_interval=200, **kwargs):  
super().__init__(parent, **kwargs)  

        plt.rcParams['font.sans-serif'] = ['Microsoft YaHei']  # Windows下显示中文  
        plt.rcParams['axes.unicode_minus'] = False
self.max_points = max_points  
self.update_interval = update_interval  # 毫秒  

# deque 设置 maxlen,超出自动丢弃最老的数据  
# 比手动 pop(0) 效率高得多  
self._data_buffer: dict[str, collections.deque] = {}  
self._data_lock = threading.Lock()  

self.fig = Figure(figsize=(83), dpi=96, facecolor='#0d1117')  
self.ax = self.fig.add_subplot(111)  
self._style_axes()  

self.canvas = FigureCanvasTkAgg(self.fig, master=self)  
self.canvas.get_tk_widget().pack(fill='both', expand=True)  

# 用字典管理多条曲线  
self._lines: dict[str, plt.Line2D] = {}  

self._running = False

def_style_axes(self):  
"""工业风深色主题"""
self.ax.set_facecolor('#0d1117')  
self.ax.tick_params(colors='#8b949e', labelsize=8)  
self.ax.spines['bottom'].set_color('#30363d')  
self.ax.spines['left'].set_color('#30363d')  
self.ax.spines['top'].set_visible(False)  
self.ax.spines['right'].set_visible(False)  
self.ax.grid(True, color='#21262d', linewidth=0.8)  
self.fig.patch.set_facecolor('#0d1117')  

defadd_series(self, name: str, color: str = '#58a6ff', label: str = ''):  
"""添加一条数据系列"""
self._data_buffer[name] = collections.deque(  
            [0.0] * self.max_points,  
            maxlen=self.max_points  
        )  
        line, = self.ax.plot(  
list(range(self.max_points)),  
list(self._data_buffer[name]),  
            color=color,  
            linewidth=1.5,  
            label=label or name,  
            antialiased=True
        )  
self._lines[name] = line  

if label:  
self.ax.legend(  
                facecolor='#161b22',  
                edgecolor='#30363d',  
                labelcolor='#8b949e',  
                fontsize=8
            )  

defpush_data(self, series_name: str, value: float):  
"""  
        线程安全地推入新数据点  
        可以从任意线程调用  
        """
withself._data_lock:  
if series_name inself._data_buffer:  
self._data_buffer[series_name].append(value)  

defstart(self):  
"""启动自动刷新"""
self._running = True
self._schedule_redraw()  

defstop(self):  
self._running = False

def_schedule_redraw(self):  
ifnotself._running:  
return

self._redraw()  
# 用 after() 调度下一次刷新,不阻塞主线程  
self.after(self.update_interval, self._schedule_redraw)  

def_redraw(self):  
"""  
        高效重绘:只更新曲线数据,不重建整个图表  
        比 ax.clear() + ax.plot() 快约10倍  
        """
withself._data_lock:  
for name, line inself._lines.items():  
                data = list(self._data_buffer[name])  
                line.set_ydata(data)  

# 自动调整Y轴范围  
self.ax.relim()  
self.ax.autoscale_view(scalex=False, scaley=True)  

# draw_idle() 比 draw() 更高效:  
# 它会等待Tkinter空闲时才触发重绘,避免帧率过高时的卡顿  
self.canvas.draw_idle()  


# --- 模拟实时数据采集的完整示例 ---class MonitorDashboard:  

def__init__(self):  
self.root = tk.Tk()  
self.root.title('设备实时监控')  
self.root.geometry('900x500')  
self.root.configure(bg='#0d1117')  

self._build_ui()  
self._start_data_simulation()  

def_build_ui(self):  
        title = tk.Label(  
self.root, text='实时数据监控面板',  
            font=('微软雅黑'14'bold'),  
            fg='#f0f6fc', bg='#0d1117'
        )  
        title.pack(pady=(155))  

# 实时曲线  
self.chart = RealtimeChartPanel(  
self.root,  
            max_points=120,  
            update_interval=150,  
            bg='#0d1117'
        )  
self.chart.pack(fill='both', expand=True, padx=15, pady=10)  

# 添加两条曲线  
self.chart.add_series('temperature''#ff7b72''温度(°C)')  
self.chart.add_series('pressure''#79c0ff''压力(kPa)')  
self.chart.start()  

# 数值显示区  
        val_frame = tk.Frame(self.root, bg='#161b22')  
        val_frame.pack(fill='x', padx=15, pady=(015))  

self.temp_var = tk.StringVar(value='-- °C')  
self.pres_var = tk.StringVar(value='-- kPa')  

for label_text, var, color in [  
            ('温度'self.temp_var, '#ff7b72'),  
            ('压力'self.pres_var, '#79c0ff')  
        ]:  
            f = tk.Frame(val_frame, bg='#161b22')  
            f.pack(side='left', padx=20, pady=8)  
            tk.Label(f, text=label_text, fg='#8b949e', bg='#161b22',  
                     font=('微软雅黑'10)).pack()  
            tk.Label(f, textvariable=var, fg=color, bg='#161b22',  
                     font=('Consolas'22'bold')).pack()  

def_start_data_simulation(self):  
"""模拟数据采集线程"""

defsimulate():  
            t = 0
whileTrue:  
                temp = 45 + 15 * np.sin(t * 0.1) + random.gauss(01.5)  
                pres = 101.3 + 8 * np.cos(t * 0.07) + random.gauss(00.8)  

self.chart.push_data('temperature', temp)  
self.chart.push_data('pressure', pres)  

# 通过 after() 更新数值标签,保证线程安全  
self.root.after(0lambda t=temp, p=pres: (  
self.temp_var.set(f'{t:.1f} °C'),  
self.pres_var.set(f'{p:.2f} kPa')  
                ))  

                t += 1
                time.sleep(0.1)  

        thread = threading.Thread(target=simulate, daemon=True)  
        thread.start()  

defrun(self):  
self.root.mainloop()  

if __name__ == '__main__':  
    MonitorDashboard().run()

draw_idle() 和 draw() 的区别值得多说一句。draw() 是立即重绘,调用频率太高会把主线程撑满,界面其他操作就没有响应时间了。draw_idle() 则是把重绘请求放进队列,等Tkinter事件循环空闲时再执行——这个"懒惰"的策略,在高频刷新场景下反而性能更好。


🖼️ 融合三:PIL/Pillow图片处理与显示

Tkinter原生的 PhotoImage 只支持GIF和PNG,连JPG都不认。项目里要显示图片、做图片处理预览,Pillow几乎是必选项。

from PIL import Image, ImageTk, ImageDraw, ImageFilter, ImageEnhance
import io


classImageViewer(tk.Frame):
"""
    图片查看与处理面板
    支持缩放、旋转、滤镜预览
    """


def__init__(self, parent, **kwargs):
super().__init__(parent, **kwargs)

self._original_image: Image.Image | None = None
self._display_image: ImageTk.PhotoImage | None = None# 必须保持引用,否则GC会回收

self._build_ui()

def_build_ui(self):
# 图片显示区
self.canvas = tk.Canvas(self, bg='#2d2d2d', cursor='crosshair')
self.canvas.pack(fill='both', expand=True)

# 操作栏
        ctrl = tk.Frame(self, bg='#1e1e1e')
        ctrl.pack(fill='x')

self.scale_var = tk.DoubleVar(value=1.0)
        tk.Scale(
            ctrl, from_=0.1, to=3.0, resolution=0.1,
            variable=self.scale_var, orient='horizontal',
            label='缩放', length=200, bg='#1e1e1e', fg='white',
            command=lambda v: self._refresh_display()
        ).pack(side='left', padx=10)

self.brightness_var = tk.DoubleVar(value=1.0)
        tk.Scale(
            ctrl, from_=0.1, to=3.0, resolution=0.1,
            variable=self.brightness_var, orient='horizontal',
            label='亮度', length=200, bg='#1e1e1e', fg='white',
            command=lambda v: self._refresh_display()
        ).pack(side='left', padx=10)

for text, cmd in [('旋转90°'self._rotate), ('模糊'self._blur), ('还原'self._reset)]:
            tk.Button(ctrl, text=text, command=cmd, bg='#3c3c3c', fg='white',
                      relief='flat', padx=8).pack(side='left', padx=4, pady=6)

defload_image(self, path: str):
"""加载图片文件"""
try:
self._original_image = Image.open(path)
# 转换为RGBA,统一处理透明度
ifself._original_image.mode != 'RGBA':
self._original_image = self._original_image.convert('RGBA')
self._working_image = self._original_image.copy()
self._refresh_display()
except Exception as e:
print(f'图片加载失败: {e}')

defload_from_bytes(self, data: bytes):
"""从字节数据加载图片(适用于网络图片或数据库BLOB)"""
self._original_image = Image.open(io.BytesIO(data))
ifself._original_image.mode != 'RGBA':
self._original_image = self._original_image.convert('RGBA')
self._working_image = self._original_image.copy()
self._refresh_display()

def_refresh_display(self):
ifself._working_image isNone:
return

        img = self._working_image.copy()

# 应用亮度调整
        brightness = self.brightness_var.get()
ifabs(brightness - 1.0) > 0.05:
            enhancer = ImageEnhance.Brightness(img)
            img = enhancer.enhance(brightness)

# 应用缩放
        scale = self.scale_var.get()
        new_w = int(img.width * scale)
        new_h = int(img.height * scale)
if new_w > 0and new_h > 0:
            img = img.resize((new_w, new_h), Image.LANCZOS)

# 关键:ImageTk.PhotoImage 对象必须保存到实例变量
# 如果只是局部变量,方法返回后会被GC回收,Canvas上图片变空白
self._display_image = ImageTk.PhotoImage(img)

self.canvas.delete('all')
# 图片居中显示
        canvas_w = self.canvas.winfo_width() or400
        canvas_h = self.canvas.winfo_height() or300
self.canvas.create_image(
            canvas_w // 2, canvas_h // 2,
            anchor='center',
            image=self._display_image
        )

def_rotate(self):
ifself._working_image:
self._working_image = self._working_image.rotate(90, expand=True)
self._refresh_display()

def_blur(self):
ifself._working_image:
self._working_image = self._working_image.filter(ImageFilter.GaussianBlur(radius=3))
self._refresh_display()

def_reset(self):
ifself._original_image:
self._working_image = self._original_image.copy()
self.scale_var.set(1.0)
self.brightness_var.set(1.0)
self._refresh_display()

PIL融合里最经典的坑,没有之一——ImageTk.PhotoImage 对象必须保存到实例变量或全局变量。如果只赋给局部变量,Python垃圾回收器认为没人引用它,下一次GC就把它回收了,Canvas上的图片随即变成空白。这个问题不报错、不抛异常,只是图片消失,排查起来让人抓狂。代码里 self._display_image = ImageTk.PhotoImage(img) 那一行,就是专门防这个坑的。


🎨 融合四:ttkbootstrap快速美化界面

原生Tkinter的控件样式在2025年看起来确实有点"复古"。ttkbootstrap 是一个基于 ttk 的主题扩展库,一行代码切换主题,控件样式立刻现代化,而且完全兼容原有的 ttk 代码。

# pip install ttkbootstrap  
import ttkbootstrap as ttk  
from ttkbootstrap.constants import *  
from ttkbootstrap.scrolled import ScrolledFrame  


classModernApp:  

def__init__(self):  
# 替换 tk.Tk(),直接指定主题  
# 可选主题:cosmo, flatly, litera, minty, lumen, sandstone,  
#           yeti, pulse, united, morph, journal, darkly, superhero,        #           solar, cyborg, vapor, simplex, cerculean        
self.root = ttk.Window(themename='darkly')  
self.root.title('BootStrap界面示例')  
self.root.geometry('700x500')  

self._build_ui()  

def_build_ui(self):  
# ttkbootstrap 的控件用 bootstyle 参数指定样式变体  
# 不需要手动设置颜色,主题自动处理  

        header = ttk.Label(  
self.root,  
            text='设备管理系统',  
            font=('微软雅黑'18'bold'),  
            bootstyle='inverse-dark'# 反色标签,类似badge效果  
        )  
        header.pack(fill='x', padx=0, pady=0)  

# 主内容区  
        content = ttk.Frame(self.root, padding=15)  
        content.pack(fill='both', expand=True)  

# 进度条示例  
        ttk.Label(content, text='系统负载', font=('微软雅黑'10)).grid(  
            row=0, column=0, sticky='w', pady=5)  

self.progress = ttk.Progressbar(  
            content, value=68, maximum=100,  
            bootstyle='success-striped',  # 绿色条纹进度条  
            length=300
        )  
self.progress.grid(row=0, column=1, padx=10, pady=5)  

        ttk.Label(content, text='68%', bootstyle='success').grid(row=0, column=2)  

# 按钮组——不同 bootstyle 对应不同语义颜色  
        btn_frame = ttk.Frame(content)  
        btn_frame.grid(row=1, column=0, columnspan=3, pady=15)  

for text, style in [  
            ('启动''success'),  
            ('暂停''warning'),  
            ('停止''danger'),  
            ('配置''info'),  
            ('导出''secondary'),  
        ]:  
            ttk.Button(  
                btn_frame, text=text,  
                bootstyle=style,  
                width=8
            ).pack(side='left', padx=5)  

# 带滚动的内容区(ttkbootstrap内置,不用手动配置Scrollbar)  
        scrolled = ScrolledFrame(content, height=200, autohide=True)  
        scrolled.grid(row=2, column=0, columnspan=3, sticky='ew', pady=10)  

for i inrange(20):  
            status = ['运行中''待机''故障'][i % 3]  
            style = ['success''secondary''danger'][i % 3]  
            row_frame = ttk.Frame(scrolled)  
            row_frame.pack(fill='x', pady=1)  
            ttk.Label(row_frame, text=f'设备 #{i + 1:03d}', width=12).pack(side='left')  
            ttk.Label(  
                row_frame, text=status,  
                bootstyle=f'{style}-inverse',  
                width=8
            ).pack(side='left', padx=5)  

# 主题切换下拉框  
        theme_frame = ttk.Frame(self.root, padding=(105))  
        theme_frame.pack(fill='x')  

        ttk.Label(theme_frame, text='切换主题:').pack(side='left')  
        theme_combo = ttk.Combobox(  
            theme_frame,  
            values=ttk.Style().theme_names(),  
            width=15
        )  
        theme_combo.set('darkly')  
        theme_combo.pack(side='left', padx=8)  
        theme_combo.bind('<<ComboboxSelected>>',  
lambda e: ttk.Style().theme_use(theme_combo.get()))  

defrun(self):  
self.root.mainloop()  

if __name__ == '__main__':  
    app = ModernApp()  
    app.run()

ttkbootstrap 的 bootstyle 参数设计得很直观——successwarningdangerinfo 这些语义化名称,跟Bootstrap前端框架的命名体系一脉相承,前端转桌面开发的同学上手特别快。


📌 三句话带走核心思路

matplotlib.use('TkAgg') 必须在一切 pyplot 导入之前声明。 顺序错了,图表要么不显示要么独立弹窗,找原因能找半天。

ImageTk.PhotoImage 对象必须用实例变量持有引用。 局部变量会被GC回收,图片凭空消失,这个坑没踩过真的不容易想到。

实时刷新用 draw_idle() 而不是 draw(),数据推送用线程,UI回调用 after() 这三件事配合起来,才能做到数据实时、界面流畅、不卡不死。

本文涉及的四个融合场景——matplotlib静态图表、实时动态曲线、PIL图片处理、ttkbootstrap主题美化——覆盖了桌面数据工具开发里最常见的需求组合。

如果你在实际项目里把matplotlib和PIL同时嵌入同一个窗口,有时会遇到字体渲染冲突(中文字体在matplotlib里显示正常,但PIL绘制的文字却变成方块)——这个问题的根源在于两个库各自维护了一套字体查找机制,解法是统一用 FontProperties 显式指定字体文件路径,而不是依赖字体名称自动匹配。欢迎在评论区聊聊你在第三方库融合过程中碰到的奇怪问题,或者分享你在项目里用到了哪些其他的嵌入方案。


#Python开发#Tkinter#matplotlib#数据可视化#桌面应用开发

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-03 22:55:32 HTTP/2.0 GET : https://f.mffb.com.cn/a/487254.html
  2. 运行时间 : 0.717561s [ 吞吐率:1.39req/s ] 内存消耗:4,906.20kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=9e4efc95f17f8273e73e52a382fc0105
  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.000983s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001468s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.017726s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.036491s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001591s ]
  6. SELECT * FROM `set` [ RunTime:0.042448s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001643s ]
  8. SELECT * FROM `article` WHERE `id` = 487254 LIMIT 1 [ RunTime:0.059193s ]
  9. UPDATE `article` SET `lasttime` = 1783090532 WHERE `id` = 487254 [ RunTime:0.079946s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.006078s ]
  11. SELECT * FROM `article` WHERE `id` < 487254 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.017909s ]
  12. SELECT * FROM `article` WHERE `id` > 487254 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.034387s ]
  13. SELECT * FROM `article` WHERE `id` < 487254 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.068070s ]
  14. SELECT * FROM `article` WHERE `id` < 487254 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.045538s ]
  15. SELECT * FROM `article` WHERE `id` < 487254 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.113984s ]
0.721920s