当前位置:首页>python>python小程序之Tkinter猜数字游戏

python小程序之Tkinter猜数字游戏

  • 2026-03-27 10:08:44
python小程序之Tkinter猜数字游戏

3.26

Tkinter猜数字游戏

今天我们使用Tkinter构建一个猜数字游戏。我们将采用面向对象与模块化的设计方法,将界面、逻辑与控制分离,以实现清晰的结构、良好的代码复用性,并使程序更易于维护与扩展。

1

构思

我们将创建一个简单的猜数字游戏,使用Tkinter,并采用面向对象和模块化的方式。

(1)文件结构

main.py       # 主程序入口,创建主窗口和控制器

game_page.py     # 游戏页面

welcome_page.py  # 欢迎页面

result_page.py   # 结果显示页面

(2)游戏流程

a.欢迎页面:用户点击开始按钮进入游戏页面。

b.游戏页面:用户输入一个数字,点击猜测按钮。

c.结果页面:显示猜测结果(太大、太小或正确),并提供返回游戏页面或欢迎页面的按钮。

我们将使用面向对象的方式,每个页面都是一个类,继承自Frame,便于在同一个窗口中切换。

注意:为了简化,我们只用一个窗口,通过切换不同的Frame来实现分页效果。

2

文件结构

guess_number/

├── main.py          # 主程序入口

├── welcome_page.py  # 欢迎页面 

├── game_page.py     # 游戏页面 

└── result_page.py   # 结果显示页面

3

代码实现

(1)main.py(主程序)

import tkinter as tkfrom welcome_page import WelcomePagefrom game_page import GamePagefrom result_page import ResultPageclass GuessNumberApp(tk.Tk):    def __init__(self):        super().__init__()        self.title("猜数字游戏")        self.geometry("400x300")        self.resizable(FalseFalse)        # 创建容器框架        container = tk.Frame(self)        container.pack(side="top", fill="both", expand=True)        container.grid_rowconfigure(0, weight=1)        container.grid_columnconfigure(0, weight=1)        # 存储所有页面        self.pages = {}        # 初始化所有页面        for PageClass in (WelcomePage, GamePage, ResultPage):            page_name = PageClass.__name__            page = PageClass(parent=container, controller=self)            self.pages[page_name] = page            page.grid(row=0, column=0, sticky="nsew")        # 显示欢迎页面        self.show_page("WelcomePage")    def show_page(self, page_name):        """显示指定页面"""        page = self.pages[page_name]        page.tkraise()    def start_game(self):        """开始新游戏"""        self.pages["GamePage"].reset_game()        self.show_page("GamePage")    def show_result(self, attempts, is_win):        """显示结果页面"""        self.pages["ResultPage"].set_result(attempts, is_win)        self.show_page("ResultPage")if __name__ == "__main__":    app = GuessNumberApp()    app.mainloop()

(2)welcome_page.py(欢迎页面)

import tkinter as tkclass WelcomePage(tk.Frame):    def __init__(self, parent, controller):        super().__init__(parent)        self.controller = controller        self.create_widgets()    def create_widgets(self):        # 标题        title_label = tk.Label(            self,            text="欢迎来到猜数字游戏",            font=("Arial"20"bold"),            fg="#333333"        )        title_label.pack(pady=30)        # 游戏说明        instructions = tk.Label(            self,            text="游戏规则:\n\n"                 "1. 系统会随机生成一个1-100之间的数字\n"                 "2. 你有10次机会猜出这个数字\n"                 "3. 每次猜测后,系统会提示你猜的数字是太大还是太小",            font=("Arial"12),            justify="left"        )        instructions.pack(pady=10)        # 开始按钮        start_button = tk.Button(            self,            text="开始游戏",            font=("Arial"14"bold"),            bg="#4CAF50",            fg="white",            padx=20,            pady=10,            command=lambdaself.controller.start_game()        )        start_button.pack(pady=30)

(3)game_page.py(游戏页面)

import tkinter as tkimport randomclass GamePage(tk.Frame):    def __init__(self, parent, controller):        super().__init__(parent)        self.controller = controller        # 游戏变量        self.secret_number = 0        self.attempts = 0        self.max_attempts = 10        self.create_widgets()        self.reset_game()    def create_widgets(self):        # 标题        self.title_label = tk.Label(            self,            text="猜数字游戏",            font=("Arial"18"bold"),            fg="#333333"        )        self.title_label.pack(pady=10)        # 提示标签        self.hint_label = tk.Label(            self,            text="请输入1-100之间的数字:",            font=("Arial"12)        )        self.hint_label.pack(pady=5)        # 输入框        self.entry = tk.Entry(            self,            font=("Arial"14),            width=10,            justify="center"        )        self.entry.pack(pady=5)        self.entry.bind("<Return>"self.check_guess)  # 绑定回车键        # 猜测按钮        self.guess_button = tk.Button(            self,            text="猜",            font=("Arial"12"bold"),            bg="#2196F3",            fg="white",            padx=15,            pady=5,            command=self.check_guess        )        self.guess_button.pack(pady=10)        # 结果标签        self.result_label = tk.Label(            self,            text="",            font=("Arial"12),            fg="#FF5722"        )        self.result_label.pack(pady=5)        # 剩余次数        self.attempts_label = tk.Label(            self,            text=f"剩余次数: {self.max_attempts}",            font=("Arial"10)        )        self.attempts_label.pack(pady=5)        # 返回按钮        back_button = tk.Button(            self,            text="返回主菜单",            font=("Arial"10),            bg="#9E9E9E",            fg="white",            command=lambdaself.controller.show_page("WelcomePage")        )        back_button.pack(pady=10)    def reset_game(self):        """重置游戏状态"""        self.secret_number = random.randint(1100)        self.attempts = 0        self.entry.delete(0, tk.END)        self.result_label.config(text="")        self.attempts_label.config(text=f"剩余次数: {self.max_attempts}")        self.entry.focus_set()    def check_guess(self, event=None):        """检查用户猜测的数字"""        try:            guess = int(self.entry.get())            if guess < 1or guess > 100:                self.result_label.config(text="请输入1-100之间的数字!")                return        except ValueError:            self.result_label.config(text="请输入有效的数字!")            return        self.attempts += 1        remaining = self.max_attempts - self.attempts        self.attempts_label.config(text=f"剩余次数: {remaining}")        if guess == self.secret_number:            self.controller.show_result(self.attempts, True)        elif remaining <= 0:            self.controller.show_result(self.attempts, False)        elif guess < self.secret_number:            self.result_label.config(text=f"太小了!再试一次")        else:            self.result_label.config(text=f"太大了!再试一次")        self.entry.delete(0, tk.END)        self.entry.focus_set()

(4)result_page.py(结果页面)

import tkinter as tkclass ResultPage(tk.Frame):    def __init__(self, parent, controller):        super().__init__(parent)        self.controller = controller        self.create_widgets()    def create_widgets(self):        # 结果标题        self.result_title = tk.Label(            self,            text="",            font=("Arial"18"bold"),            fg="#333333"        )        self.result_title.pack(pady=20)        # 结果详情        self.result_details = tk.Label(            self,            text="",            font=("Arial"12),            justify="center"        )        self.result_details.pack(pady=10)        # 按钮框架        button_frame = tk.Frame(self)        button_frame.pack(pady=20)        # 再玩一次按钮        play_again_button = tk.Button(            button_frame,            text="再玩一次",            font=("Arial"12"bold"),            bg="#4CAF50",            fg="white",            padx=15,            pady=5,            command=lambdaself.controller.start_game()        )        play_again_button.pack(side="left", padx=10)        # 返回主菜单按钮        menu_button = tk.Button(            button_frame,            text="返回主菜单",            font=("Arial"12),            bg="#9E9E9E",            fg="white",            padx=15,            pady=5,            command=lambdaself.controller.show_page("WelcomePage")        )        menu_button.pack(side="left", padx=10)    def set_result(self, attempts, is_win):        """设置结果信息"""        if is_win:            self.result_title.config(text="恭喜你赢了!", fg="#4CAF50")            self.result_details.config(                text=f"你用了 {attempts} 次猜中了数字!\n\n"                     "真是太棒了!"            )        else:            self.result_title.config(text="游戏结束", fg="#F44336")            self.result_details.config(                text=f"很遗憾,你没有在 {attempts} 次内猜中数字。\n\n"                     "再试一次吧!"            )

4

功能说明

(1)分页设计

欢迎页面:显示游戏规则和开始按钮

游戏页面:用户输入猜测数字并得到反馈

结果页面:显示游戏结果并提供选项

(2)面向对象编程

GuessNumberApp类:主应用程序类,管理页面切换

WelcomePage类:欢迎页面类

GamePage类:游戏逻辑实现类

ResultPage类:结果显示类

(3)功能特点

随机生成1-100之间的数字

用户有10次猜测机会

每次猜测后提供反馈(太大/太小)

游戏结束后显示结果和统计信息

支持重新开始或返回主菜单

(4)用户交互

友好的界面设计

支持回车键提交猜测

清晰的游戏状态反馈

简洁的导航按钮

5

运行结果

今日学习完毕,课后作业:

大家可以跟进上面的小程序,利用前面所学的东西,继续优化改进。希望大家能通过这些自制小程序,对python越来越喜欢。明天开始,我们继续学习新的python知识。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-03-27 15:08:59 HTTP/2.0 GET : https://f.mffb.com.cn/a/483185.html
  2. 运行时间 : 0.179365s [ 吞吐率:5.58req/s ] 内存消耗:4,975.79kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=9eb418123bbc9e7b4600596c41f26c8f
  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.000909s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001413s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000622s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000620s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001223s ]
  6. SELECT * FROM `set` [ RunTime:0.000549s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001321s ]
  8. SELECT * FROM `article` WHERE `id` = 483185 LIMIT 1 [ RunTime:0.001047s ]
  9. UPDATE `article` SET `lasttime` = 1774595339 WHERE `id` = 483185 [ RunTime:0.012118s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000611s ]
  11. SELECT * FROM `article` WHERE `id` < 483185 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001030s ]
  12. SELECT * FROM `article` WHERE `id` > 483185 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001459s ]
  13. SELECT * FROM `article` WHERE `id` < 483185 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002154s ]
  14. SELECT * FROM `article` WHERE `id` < 483185 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001973s ]
  15. SELECT * FROM `article` WHERE `id` < 483185 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.001845s ]
0.182628s