当前位置:首页>python>告别黑白终端!这个Python库让你的CLI瞬间拥有“视觉魔法”——Rich

告别黑白终端!这个Python库让你的CLI瞬间拥有“视觉魔法”——Rich

  • 2026-04-20 14:15:54
告别黑白终端!这个Python库让你的CLI瞬间拥有“视觉魔法”——Rich

如果你是一名Python开发者,你的日常工作里一定离不开命令行终端。当你日复一日地面对那些千篇一律的黑白文字时,是否也曾感叹过:难道终端就不能像现代网页一样生动多彩吗?如果有一个工具,能让你的终端输出变得五颜六色,甚至能画出精美的表格、进度条,还能直接展示高亮代码和Markdown文档,你一定会爱上它。这个工具就是——Rich!

Rich由Textualize团队开源,兼容Windows/macOS/Linux,支持Python 3.8及以上版本,核心定位就是“让终端输出像网页一样丰富多彩”。它提供了一系列强大而易用的API,让你能够轻松地为文本添加颜色、样式、高亮,创建美观的表格、进度条,渲染Markdown,甚至对Python的Traceback进行美化。

最重要的是,Rich安装即用、零额外依赖,而且与Jupyter Notebook也能完美配合。它几乎已经成为现代CLI工具的“标配”。接下来,就让我们从一行代码开始,一起走进Rich的魔法世界!

🚀 五分钟快速上手:从hello world开始

1. 安装Rich

打开终端,运行以下命令:

pip install rich

安装完成后,运行以下命令可以测试Rich在你的终端的输出效果:

python -m rich

2. 最简单的用法:替换print()

只需将原有的print()替换为rich.print(),你就能立即获得彩色输出:

from rich import printprint("Hello, [bold magenta]Rich[/bold magenta]!")print("[red]这是一个[/red] [green]带颜色的[/green] [blue]问候![/blue]")print(":rocket: :zap: :star: Let's make some awesome CLI tools! :fire:")

运行这段代码,你会立刻看到终端中彩色的、带有Emoji的输出。[bold magenta]这样的标记语法受到BBCode的启发,使用方括号来定义样式标签,支持嵌套和重叠,提供了极大的灵活性。

🎯 核心功能深度解析:让终端“活”起来

Rich之所以强大,在于它提供了众多模块化的功能。下面我们逐一深入。

1. 颜色、样式与Emoji:告别单调的黑白文本

Rich支持超过1600万种颜色组合,可以通过Markdown风格语法实现文本样式嵌套。

from rich import print# 基础颜色和样式print("[bold]粗体[/bold]")print("[italic]斜体[/italic]")print("[underline]下划线[/underline]")print("[red]红色[/red] [green]绿色[/green] [blue]蓝色[/blue]")# 组合样式print("[bold italic red on white]组合样式:粗体+斜体+红字+白底[/]")# 十六进制精确控色print("[#FF5733 on #33FF57]赛博朋克风渐变[/]")# 背景色print("[on blue]蓝色背景的文本[/on blue]")# Emoji表情:将名称放在两个冒号之间即可插入表情符号print("任务完成 :tada: 请检查结果 :mag:")

2. Console对象:更精细的控制

如果你需要更多控制,可以导入并构建一个Console对象:

from rich.console import Consoleconsole = Console()console.print("Hello""World!", style="bold red")console.print("这是普通文本")console.rule("[bold green]华丽的分隔线[/bold green]")

Console对象还提供了log()方法,能自动显示当前时间、调用文件和行号:

from rich.console import Consoleconsole = Console()console.log("这是一条日志消息")console.log({"key""value""list": [123]})  # 自动美化数据结构

log_locals参数会输出一个表格,包含调用log方法时的所有局部变量,非常适合调试。

3. 表格:专业级的数据展示

Rich的表格系统支持自动对齐、边框样式、颜色标记等功能,几行代码就能创建出媲美专业工具的表格效果。

from rich.console import Consolefrom rich.table import Tableconsole = Console()table = Table(title="星球大战电影数据")# 添加列:支持样式、对齐方式等配置table.add_column("日期", style="cyan", justify="center")table.add_column("标题", style="magenta")table.add_column("制作预算", style="green", justify="right")table.add_column("票房", style="red", justify="right")# 添加行数据table.add_row("Dec 20, 2019""Star Wars: The Rise of Skywalker""$275,000,000""$375,126,118")table.add_row("May 25, 2018""Solo: A Star Wars Story""$275,000,000""$393,151,347")table.add_row("Dec 15, 2017""Star Wars Ep. VIII: The Last Jedi""$262,000,000""$1,332,539,889")console.print(table)

更多表格定制选项:

from rich.table import Tablefrom rich import box# 选择不同的边框样式table = Table(title="数据统计", box=box.ROUNDED)          # 圆角边框table = Table(title="数据统计", box=box.DOUBLE)           # 双线边框table = Table(title="数据统计", box=box.MINIMAL)          # 极简边框# 添加更多配置table = Table(    title="成绩单",    show_header=True,    show_lines=True,           # 显示行分割线    row_styles=["dim"""],    # 斑马条纹效果    header_style="bold cyan")# 列的高级配置table.add_column("姓名", style="cyan", no_wrap=True)      # 禁止自动换行table.add_column("分数", justify="right", style="green")  # 右对齐# 表格中可以包含任何Rich可渲染对象from rich.progress import Progressprogress = Progress()progress.add_task("加载中", total=100, completed=42)table.add_row("任务进度", progress)  # 表格内嵌入进度条

4. 进度条:让长时间任务一目了然

Rich能渲染平滑动态的进度条,让你清晰地看到每项任务的完成情况,自动显示百分比、速度和剩余时间。

最简单的用法——使用track:

from rich.progress import trackimport timefor step in track(range(100), description="处理中..."):    time.sleep(0.05)  # 模拟耗时操作

自定义进度条组件:

from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TimeRemainingColumn, TimeElapsedColumnimport timewith Progress(    SpinnerColumn(),                                    # 旋转动画    TextColumn("[progress.description]{task.description}"),    BarColumn(),                                        # 进度条    TextColumn("[progress.percentage]{task.percentage:>3.0f}%"),    TimeRemainingColumn(),                              # 剩余时间    TimeElapsedColumn(),                                # 已用时间as progress:    task = progress.add_task("[cyan]正在下载文件...", total=100)    for i in range(100):        time.sleep(0.03)        progress.update(task, advance=1)

多任务并行进度条:

from rich.progress import Progressimport timewith Progress() as progress:    task1 = progress.add_task("[red]下载中...", total=100)    task2 = progress.add_task("[green]处理中...", total=50)    while not progress.finished:        progress.update(task1, advance=0.9)        progress.update(task2, advance=0.5)        time.sleep(0.1)

5. 语法高亮:直接在终端展示代码

使用pygments库,Rich支持多种编程语言的语法高亮:

from rich.console import Consolefrom rich.syntax import Syntaxconsole = Console()code = '''def fibonacci(n):    """生成斐波那契数列"""    a, b = 0, 1    while a < n:        yield a        a, b = b, a + b'''# 语法高亮,支持主题选择,可显示行号syntax = Syntax(code, "python", theme="monokai", line_numbers=True)console.print(syntax)

6. Markdown渲染:终端也能看文档

Rich可以将Markdown文档直接渲染到终端:

from rich.console import Consolefrom rich.markdown import Markdownconsole = Console()md_text = """一级标题## 二级标题这是一个 **粗体** 和 *斜体* 的示例。- 无序列表项 1- 无序列表项 2- 无序列表项 31. 有序列表项 12. 有序列表项 2> 这是一段引用文字`print("行内代码")````python代码块def hello():    print("Hello, World!")

"""

md = Markdown(md_text)

console.print(md)

也可以从文件读取

with open("README.md") as readme:

markdown = Markdown(readme.read())

console.print(markdown)

### 7. 面板与布局:让内容更结构化`Panel`类可以在任意内容周围绘制带边框的盒子,是Rich中最常用的装饰组件之一。[reference:11]```pythonfrom rich.panel import Panelfrom rich.console import Consolefrom rich.text import Textconsole = Console()# 基础面板panel = Panel("这是面板内的内容", title="标题", border_style="bright_blue")console.print(panel)# 带多个样式的内容text = Text("欢迎使用 MyCLI", style="bold cyan")panel = Panel(text, expand=False, border_style="bright_green", subtitle="v1.0")console.print(panel)# 嵌套面板inner = Panel("内部内容", title="内层", border_style="yellow")outer = Panel(inner, title="外层", border_style="red")console.print(outer)

使用Columns进行多列布局:

from rich.columns import Columnsfrom rich.panel import Panelpanels = [Panel(f"卡片 {i}", width=20for i in range(6)]columns = Columns(panels, equal=True)console.print(columns)

8. 树形结构:像tree命令一样漂亮

Rich可以渲染树形结构,非常适合展示文件系统或层级数据:

from rich.tree import Treefrom rich.console import Consoleconsole = Console()tree = Tree("📁 项目根目录")tree.add("📄 README.md")tree.add("📄 setup.py")src = tree.add("📁 src")src.add("📄 main.py")src.add("📄 utils.py")tests = tree.add("📁 tests")tests.add("📄 test_main.py")console.print(tree)

9. 美化日志输出(集成logging模块)

Rich提供了RichHandler,可以直接集成到Python的logging模块中,让日志输出自动带上颜色、级别标记和美观的堆栈跟踪:

from rich.logging import RichHandlerimport logging# 配置日志logging.basicConfig(    level="INFO",    format="%(message)s",    datefmt="[%X]",    handlers=[RichHandler(rich_tracebacks=True, tracebacks_suppress=[__file__])])log = logging.getLogger("myapp")log.debug("这是调试信息")log.info("程序启动 :rocket:")log.warning("这是个警告 :warning:")log.error("出错了!:x:")

当发生异常时,Rich会自动美化错误堆栈,支持折叠和语法高亮,调试更方便。

10. 实时刷新与动态展示

Live类可以让你创建实时刷新的动态界面,非常适合监控工具:

from rich.live import Livefrom rich.table import Tableimport psutilimport timedef create_system_table():    table = Table(title="系统监控")    table.add_column("资源", style="cyan")    table.add_column("使用率", style="magenta")    table.add_row("CPU", f"{psutil.cpu_percent()}%")    table.add_row("内存", f"{psutil.virtual_memory().percent}%")    return tablewith Live(create_system_table(), refresh_per_second=2) as live:    for _ in range(10):        time.sleep(1)        live.update(create_system_table())

11. 美化错误回溯(Traceback)

Rich可以自动美化Python的错误回溯,让错误信息更易读:

from rich.console import Consolefrom rich.traceback import install# 安装美化版tracebackinstall(show_locals=True, width=100)console = Console()console.print("[bold red]发生错误示例:[/]")def divide(a, b):    return a / btry:    result = divide(100)except Exception as e:    console.print_exception()

12. 导出与捕获输出

Rich支持将控制台输出捕获并导出为文本、HTML或SVG格式:

from rich.console import Consolefrom rich.table import Tableconsole = Console(record=True)  # 启用记录模式table = Table(title="捕获的表格")table.add_column("姓名", style="cyan")table.add_column("分数", style="green")table.add_row("张三""95")table.add_row("李四""87")console.print(table)# 导出为HTMLhtml_output = console.export_html()with open("output.html""w", encoding="utf-8"as f:    f.write(html_output)# 导出为文本text_output = console.export_text()print(text_output)

💡 最佳实践与注意事项

共享Console实例:当同时使用RichHandler和Progress时,务必共享同一个Console实例,否则日志和进度条可能会相互干扰,导致显示错乱。

from rich.console import Consolefrom rich.logging import RichHandlerfrom rich.progress import Progressconsole = Console()handler = RichHandler(console=console)progress = Progress(console=console)

适度使用样式:避免过度装饰影响可读性,保持信息清晰。

考虑可访问性:为色盲用户提供颜色主题定制,Rich支持颜色主题配置。

性能考虑:复杂的样式组合和频繁的实时更新可能影响渲染性能,在大量输出时注意优化。

转义用户输入:处理用户输入时使用escape()函数,防止样式注入攻击:

from rich.markup import escapeuser_input = "[blink]用户输入[/blink]"safe_output = escape(user_input)  # 转义为普通文本print(safe_output)

📦 配合Typer使用:CLI工具的黄金搭档

Rich经常与Typer配合使用,打造专业级的命令行工具:

import typerfrom rich.console import Consolefrom rich.progress import Progress, BarColumn, TextColumnimport timeapp = typer.Typer(help="Rich + Typer = 无敌组合")console = Console()@app.command()def process(count: int = 10):    console.rule("[bold red]开始处理任务[/bold red]")    with Progress(        TextColumn("[progress.description]{task.description}"),        BarColumn(),        TextColumn("[progress.percentage]{task.percentage:>3.0f}%"),    ) as progress:        task = progress.add_task("[cyan]处理文件中...", total=count)        for i in range(count):            time.sleep(0.2)            progress.update(task, advance=1)    console.print("[green]✓ 处理完成![/green] :tada:")if __name__ == "__main__":    app()

🎬 结语

Rich不仅仅是一个美化库,更是一个功能强大的工具集,能够让你的Python终端输出瞬间高大上,提升开发效率,改善用户体验,让你的CLI项目脱胎换骨。无论是日常调试、日志输出,还是打造专业级的命令行工具,Rich都能为你带来前所未有的体验。

从今天开始,告别那“千篇一律”的黑白终端吧!只需一行pip install rich,你就能开启终端输出的全新世界。

参考资源:

官方文档:https://rich.readthedocs.io/

GitHub仓库:https://github.com/Textualize/rich

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-20 19:19:12 HTTP/2.0 GET : https://f.mffb.com.cn/a/484664.html
  2. 运行时间 : 0.119429s [ 吞吐率:8.37req/s ] 内存消耗:4,847.30kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=0d7951761666729bec47bf37b3c2c700
  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.000561s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000704s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000629s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.001076s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000671s ]
  6. SELECT * FROM `set` [ RunTime:0.001951s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000664s ]
  8. SELECT * FROM `article` WHERE `id` = 484664 LIMIT 1 [ RunTime:0.000789s ]
  9. UPDATE `article` SET `lasttime` = 1776683952 WHERE `id` = 484664 [ RunTime:0.003981s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000380s ]
  11. SELECT * FROM `article` WHERE `id` < 484664 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000684s ]
  12. SELECT * FROM `article` WHERE `id` > 484664 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000500s ]
  13. SELECT * FROM `article` WHERE `id` < 484664 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002862s ]
  14. SELECT * FROM `article` WHERE `id` < 484664 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.006746s ]
  15. SELECT * FROM `article` WHERE `id` < 484664 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.006344s ]
0.121174s