当前位置:首页 > 文章列表 > 文章 > python教程 > Dash应用标题图标修改教程

Dash应用标题图标修改教程

2025-12-18 09:54:37 0浏览 收藏

对于一个文章开发者来说,牢固扎实的基础是十分重要的,golang学习网就来带大家一点点的掌握基础知识点。今天本篇文章带大家了解《Dash 应用定制:修改 HTML 标题与图标教程》,主要介绍了,希望对大家的知识积累有所帮助,快点收藏起来吧,否则需要时就找不到了!

Dash 应用定制:轻松更改 HTML 页面标题与网站图标 (Favicon)

本教程详细介绍了如何在 Dash Python 应用程序中自定义 HTML 页面的标题和网站图标(Favicon)。通过设置 app.title 属性可以轻松修改页面标题,而 app.favicon 属性则用于指定网站图标,图标文件需放置在应用的 assets 文件夹中。本文将提供清晰的代码示例和注意事项,帮助开发者优化 Dash 应用的用户体验。

1. 理解 Dash 应用的页面结构

在 Dash 应用开发中,app.layout 属性主要负责定义页面的主体内容和组件结构,它承载了用户界面的所有交互元素和展示内容。然而,HTML 页面的元信息,例如 标签(浏览器标签页上显示的标题)和 <link rel="icon"> 标签(网站图标,即 Favicon),并不直接通过 app.layout 中的 HTML 组件来设置。Dash 框架为这些页面级别的元数据提供了专门的属性,以实现更便捷和规范的配置。</p><h3>2. 设置 HTML 页面标题</h3><p>更改 Dash 应用的 HTML 页面标题是一个非常直接的操作。Dash 实例对象提供了一个 title 属性,您只需将其赋值为所需的字符串即可。当应用运行时,浏览器标签页上将显示您设置的这个标题。</p><p><strong>示例代码:</strong></p><pre class="brush:php;toolbar:false">import dash from dash import html # 初始化 Dash 应用 app = dash.Dash(__name__) # 设置页面标题 app.title = "我的定制 Dash 应用" # 定义应用布局 app.layout = html.Div([ html.H1("欢迎来到我的 Dash 应用"), html.P("这是一个带有自定义标题的示例页面。") ]) if __name__ == '__main__': app.run_server(debug=True)</pre><p>运行上述代码,并在浏览器中打开您的 Dash 应用,您会发现浏览器标签页上显示的标题已成功变为“我的定制 Dash 应用”。</p><h3>3. 配置网站图标 (Favicon)</h3><p>网站图标(Favicon)是显示在浏览器标签页、书签栏或收藏夹中的小图标,它对于提升品牌识别度和用户体验至关重要。在 Dash 应用中,您可以通过设置 app.favicon 属性来指定网站图标。</p><p><strong>关键要求:</strong></p><ul><li><strong>文件位置:</strong> 网站图标文件必须放置在您的 Dash 应用根目录下的一个名为 assets 的文件夹中。如果 assets 文件夹不存在,请在项目根目录下手动创建它。Dash 会自动识别并服务此文件夹中的静态文件。</li><li><strong>文件格式:</strong> Dash 通常支持 .ico、.png、.svg 等常见的图片格式作为 Favicon。为了获得最佳兼容性,推荐使用 .ico 格式,或使用 .png 格式。</li></ul><p><strong>示例代码:</strong></p><p>假设您的项目结构如下,其中 my_icon.png 是您希望用作网站图标的图片文件:</p><pre class="brush:php;toolbar:false">your_dash_app/ ├── app.py └── assets/ └── my_icon.png</pre><p>在 app.py 中设置 Favicon:</p><pre class="brush:php;toolbar:false">import dash from dash import html app = dash.Dash(__name__) # 设置页面标题 app.title = "我的定制 Dash 应用" # 设置网站图标 # 确保 'my_icon.png' 文件位于 'assets' 文件夹中 app.favicon = "my_icon.png" app.layout = html.Div([ html.H1("欢迎来到我的 Dash 应用"), html.P("这是一个带有自定义标题和图标的示例页面。") ]) if __name__ == '__main__': app.run_server(debug=True)</pre><p>运行此应用后,浏览器标签页上除了显示定制的标题外,还会显示您指定的 my_icon.png 图标。</p><h3>4. 完整示例与注意事项</h3><p>以下是一个结合了标题和 Favicon 设置的完整 Dash 应用示例,展示了如何同时配置这两项元信息:</p><pre class="brush:php;toolbar:false">import dash from dash import html # 初始化 Dash 应用 app = dash.Dash(__name__) # --- 自定义应用元信息 --- app.title = "我的精彩 Dash 应用" # 设置浏览器标签页标题 app.favicon = "custom_favicon.ico" # 设置网站图标,确保文件在 'assets' 目录下 # ------------------------- # 定义应用布局 app.layout = html.Div([ html.H1("你好,Dash 世界!"), html.P("这是一个带有自定义标题和图标的 Dash 应用。"), html.Img(src=app.get_asset_url('dash_logo.png'), style={'height':'50px'}) # 示例:如何在布局中引用 assets 文件夹中的其他图片 ]) if __name__ == '__main__': app.run_server(debug=True)</pre><p><strong>重要注意事项:</strong></p><ul><li><strong>assets 文件夹的命名和位置:</strong> assets 文件夹必须命名为 assets 且位于 Dash 应用的根目录下(即与 app.py 文件同级),Dash 才能自动识别并服务其中的静态文件。</li><li><strong>浏览器缓存:</strong> 更改 Favicon 后,浏览器可能会因为缓存机制而不会立即显示新图标。如果遇到这种情况,您可以尝试清除浏览器缓存、使用无痕模式浏览,或强制刷新页面(通常是 Ctrl + F5 或 Cmd + Shift + R)。</li><li><strong>图标尺寸与兼容性:</strong> 常见的 Favicon 尺寸有 16x16、32x32、48x48 像素。为了获得最佳兼容性和显示效果,建议提供一个多尺寸的 .ico 文件,或者使用 32x32 或 16x16 像素的 .png 文件。</li><li><strong>html.Title 与 app.title 的区别:</strong> <ul><li>html.Title 是 dash_html_components 中的一个组件,如果将其放置在 app.layout 中,它会在页面的 <em>内容区域</em> 渲染一个 <title> 标签(这通常不是我们想要的效果,因为浏览器会忽略页面主体中的 <title>)。</li><li>app.title 属性是用于设置浏览器标签页的全局标题,这是正确且推荐的方式。</li></ul></li></ul><h3>总结</h3><p>通过本教程,您已经掌握了在 Dash 应用中自定义 HTML 页面标题和网站图标(Favicon)的方法。利用 app.title 属性和 app.favicon 属性,并结合 assets 文件夹的正确使用,您可以轻松地为您的 Dash 应用提供更专业的品牌标识和更优的用户体验。请记住,正确的图标文件放置路径和命名是成功设置的关键。</p><p>以上就是《Dash应用标题图标修改教程》的详细内容,更多关于的资料请关注golang学习网公众号!</p> </div> <div class="labsList"> </div> <div class="cateBox"> <div class="cateItem"> <a href="/article/425165.html" title="LangchainFaiss内存优化方法解析" class="img_box"> <img src="/uploads/20251218/176602287669435edcaa4fc.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="LangchainFaiss内存优化方法解析">LangchainFaiss内存优化方法解析 </a> <dl> <dt class="lineOverflow"><a href="/article/425165.html" title="LangchainFaiss内存优化方法解析" class="aBlack">上一篇<i></i></a></dt> <dd class="lineTwoOverflow">LangchainFaiss内存优化方法解析</dd> </dl> </div> <div class="cateItem"> <a href="/article/425167.html" title="谷歌邮箱绑定YouTube教程" class="img_box"> <img src="/uploads/20251218/176602287369435ed99db3b.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="谷歌邮箱绑定YouTube教程"> </a> <dl> <dt class="lineOverflow"><a href="/article/425167.html" class="aBlack" title="谷歌邮箱绑定YouTube教程">下一篇<i></i></a></dt> <dd class="lineTwoOverflow">谷歌邮箱绑定YouTube教程</dd> </dl> </div> </div> </div> </div> <div class="leftContBox pt0"> <div class="pdl20"> <div class="contTit"> <a href="/articlelist.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit">最新文章</div> </div> </div> <ul class="newArticleList"> <li> <div class="contBox"> <a href="/article/630258.html" class="img_box" title="Python 日志 QueueHandler 解决多进程写入争用"> <img src="/uploads/20261008/1791461511-75fb64b1ad-8d4456a483-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python 日志 QueueHandler 解决多进程写入争用"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  33分钟前  |   <a href="/articletag/1138_new_0_1.html" class="aLightGray" title="并发编程">并发编程</a> · <a href="/articletag/39701_new_0_1.html" class="aLightGray" title="工程实践">工程实践</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="多进程日志">多进程日志</a> <a href="javascript:;" class="aLightGray" title="QueueListener">QueueListener</a> <a href="javascript:;" class="aLightGray" title="multiprocessing.Queue">multiprocessing.Queue</a> <a href="javascript:;" class="aLightGray" title="RotatingFileHandler">RotatingFileHandler</a> <a href="javascript:;" class="aLightGray" title="Python QueueHandler">Python QueueHandler</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630258.html" class="aBlack" target="_blank" title="Python 日志 QueueHandler 解决多进程写入争用">Python 日志 QueueHandler 解决多进程写入争用</a> </dt> <dd class="cont2"> <span><i class="view"></i>186浏览</span> <span class="collectBtn user_collection" data-id="630258" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630234.html" class="img_box" title="Pydantic 模型更新时区分未提供字段与显式空值"> <img src="/uploads/20261008/1791453226-a5d274f0a5-e28e060fdd-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Pydantic 模型更新时区分未提供字段与显式空值"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  2小时前  |   <a href="/articletag/852_new_0_1.html" class="aLightGray" title="数据校验">数据校验</a> · <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="javascript:;" class="aLightGray" title="Pydantic 部分更新">Pydantic 部分更新</a> <a href="javascript:;" class="aLightGray" title="exclude_unset">exclude_unset</a> <a href="javascript:;" class="aLightGray" title="model_fields_set">model_fields_set</a> <a href="javascript:;" class="aLightGray" title="显式空值">显式空值</a> <a href="javascript:;" class="aLightGray" title="model_dump">model_dump</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630234.html" class="aBlack" target="_blank" title="Pydantic 模型更新时区分未提供字段与显式空值">Pydantic 模型更新时区分未提供字段与显式空值</a> </dt> <dd class="cont2"> <span><i class="view"></i>399浏览</span> <span class="collectBtn user_collection" data-id="630234" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630210.html" class="img_box" title="pytest Fixture 作用域如何影响测试隔离与速度"> <img src="/uploads/20261008/1791445131-154e755dba-fffe00028a-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="pytest Fixture 作用域如何影响测试隔离与速度"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  5小时前  |   </span> </dd> <dt class="lineOverflow"> <a href="/article/630210.html" class="aBlack" target="_blank" title="pytest Fixture 作用域如何影响测试隔离与速度">pytest Fixture 作用域如何影响测试隔离与速度</a> </dt> <dd class="cont2"> <span><i class="view"></i>341浏览</span> <span class="collectBtn user_collection" data-id="630210" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630186.html" class="img_box" title="Pathlib 安全拼接用户路径:解析后再验证根目录"> <img src="/uploads/20261008/1791436938-5e3785c25b-1c2af0f914-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Pathlib 安全拼接用户路径:解析后再验证根目录"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  7小时前  |   <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="/articletag/39791_new_0_1.html" class="aLightGray" title="pathlib">pathlib</a> · <a href="javascript:;" class="aLightGray" title="路径安全">路径安全</a> <a href="javascript:;" class="aLightGray" title="Python pathlib">Python pathlib</a> <a href="javascript:;" class="aLightGray" title="Path.resolve">Path.resolve</a> <a href="javascript:;" class="aLightGray" title="目录穿越">目录穿越</a> <a href="javascript:;" class="aLightGray" title="relative_to">relative_to</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630186.html" class="aBlack" target="_blank" title="Pathlib 安全拼接用户路径:解析后再验证根目录">Pathlib 安全拼接用户路径:解析后再验证根目录</a> </dt> <dd class="cont2"> <span><i class="view"></i>463浏览</span> <span class="collectBtn user_collection" data-id="630186" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630162.html" class="img_box" title="multiprocessing 传输大对象为何变慢,如何减少序列化"> <img src="/uploads/20261008/1791429251-d3326b4814-bc31a5cb77-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="multiprocessing 传输大对象为何变慢,如何减少序列化"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  9小时前  |   <a href="/articletag/729_new_0_1.html" class="aLightGray" title="性能优化">性能优化</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="Python">Python</a> <a href="javascript:;" class="aLightGray" title="进程间通信">进程间通信</a> <a href="javascript:;" class="aLightGray" title="pickle">pickle</a> <a href="javascript:;" class="aLightGray" title="multiprocessing">multiprocessing</a> <a href="javascript:;" class="aLightGray" title="SharedMemory">SharedMemory</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630162.html" class="aBlack" target="_blank" title="multiprocessing 传输大对象为何变慢,如何减少序列化">multiprocessing 传输大对象为何变慢,如何减少序列化</a> </dt> <dd class="cont2"> <span><i class="view"></i>478浏览</span> <span class="collectBtn user_collection" data-id="630162" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630139.html" class="img_box" title="Python import 很慢怎么分析:模块级副作用与延迟导入"> <img src="/uploads/20261007/1791361630-cd1a6487b1-ba8a53104a-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python import 很慢怎么分析:模块级副作用与延迟导入"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="javascript:;" class="aLightGray" title="Python import很慢">Python import很慢</a> <a href="javascript:;" class="aLightGray" title="-X importtime">-X importtime</a> <a href="javascript:;" class="aLightGray" title="模块级副作用">模块级副作用</a> <a href="javascript:;" class="aLightGray" title="延迟导入">延迟导入</a> <a href="javascript:;" class="aLightGray" title="Python启动优化">Python启动优化</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630139.html" class="aBlack" target="_blank" title="Python import 很慢怎么分析:模块级副作用与延迟导入">Python import 很慢怎么分析:模块级副作用与延迟导入</a> </dt> <dd class="cont2"> <span><i class="view"></i>292浏览</span> <span class="collectBtn user_collection" data-id="630139" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630116.html" class="img_box" title="contextvars 在异步请求链中传递追踪信息"> <img src="/uploads/20261007/1791353902-75ab262824-2c9918dca7-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="contextvars 在异步请求链中传递追踪信息"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="/articletag/5173_new_0_1.html" class="aLightGray" title="异步编程">异步编程</a> · <a href="javascript:;" class="aLightGray" title="Python">Python</a> <a href="javascript:;" class="aLightGray" title="asyncio">asyncio</a> <a href="javascript:;" class="aLightGray" title="contextvars">contextvars</a> <a href="javascript:;" class="aLightGray" title="request_id">request_id</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630116.html" class="aBlack" target="_blank" title="contextvars 在异步请求链中传递追踪信息">contextvars 在异步请求链中传递追踪信息</a> </dt> <dd class="cont2"> <span><i class="view"></i>393浏览</span> <span class="collectBtn user_collection" data-id="630116" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630092.html" class="img_box" title="生成器管道处理大文件:背压、关闭与异常传播"> <img src="/uploads/20261007/1791346489-23f55a053a-58eecd7f23-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="生成器管道处理大文件:背压、关闭与异常传播"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/16_new_0_1.html" class="aLightGray" title="文件处理">文件处理</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="大文件处理">大文件处理</a> <a href="javascript:;" class="aLightGray" title="异常传播">异常传播</a> <a href="javascript:;" class="aLightGray" title="Python生成器">Python生成器</a> <a href="javascript:;" class="aLightGray" title="背压">背压</a> <a href="javascript:;" class="aLightGray" title="生成器close">生成器close</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630092.html" class="aBlack" target="_blank" title="生成器管道处理大文件:背压、关闭与异常传播">生成器管道处理大文件:背压、关闭与异常传播</a> </dt> <dd class="cont2"> <span><i class="view"></i>126浏览</span> <span class="collectBtn user_collection" data-id="630092" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630068.html" class="img_box" title="用 dataclass slots 降低大量小对象的内存占用"> <img src="/uploads/20261007/1791338595-04688a89ec-69bcca6e8b-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="用 dataclass slots 降低大量小对象的内存占用"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/729_new_0_1.html" class="aLightGray" title="性能优化">性能优化</a> · <a href="/articletag/39719_new_0_1.html" class="aLightGray" title="Python教程">Python教程</a> · <a href="javascript:;" class="aLightGray" title="Python">Python</a> <a href="javascript:;" class="aLightGray" title="内存优化">内存优化</a> <a href="javascript:;" class="aLightGray" title="__slots__">__slots__</a> <a href="javascript:;" class="aLightGray" title="tracemalloc">tracemalloc</a> <a href="javascript:;" class="aLightGray" title="dataclass">dataclass</a> <a href="javascript:;" class="aLightGray" title="slots">slots</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630068.html" class="aBlack" target="_blank" title="用 dataclass slots 降低大量小对象的内存占用">用 dataclass slots 降低大量小对象的内存占用</a> </dt> <dd class="cont2"> <span><i class="view"></i>427浏览</span> <span class="collectBtn user_collection" data-id="630068" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630042.html" class="img_box" title="Python 类型参数语法如何改写通用容器与函数"> <img src="/uploads/20261007/1791330462-9b04adbf11-bf5c78467a-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python 类型参数语法如何改写通用容器与函数"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/598_new_0_1.html" class="aLightGray" title="泛型">泛型</a> · <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="javascript:;" class="aLightGray" title="泛型函数">泛型函数</a> <a href="javascript:;" class="aLightGray" title="类型别名">类型别名</a> <a href="javascript:;" class="aLightGray" title="PEP 695">PEP 695</a> <a href="javascript:;" class="aLightGray" title="Python 类型参数">Python 类型参数</a> <a href="javascript:;" class="aLightGray" title="TypeVar">TypeVar</a> <a href="javascript:;" class="aLightGray" title="Generic">Generic</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630042.html" class="aBlack" target="_blank" title="Python 类型参数语法如何改写通用容器与函数">Python 类型参数语法如何改写通用容器与函数</a> </dt> <dd class="cont2"> <span><i class="view"></i>132浏览</span> <span class="collectBtn user_collection" data-id="630042" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/630019.html" class="img_box" title="asyncio TaskGroup 让并发任务在首错时一起收敛"> <img src="/uploads/20261007/1791323028-6a16e070df-25ba663de9-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="asyncio TaskGroup 让并发任务在首错时一起收敛"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   <a href="/articletag/19_new_0_1.html" class="aLightGray" title="并发">并发</a> · <a href="/articletag/1031_new_0_1.html" class="aLightGray" title="异常处理">异常处理</a> · <a href="/articletag/2337_new_0_1.html" class="aLightGray" title="python">python</a> · <a href="/articletag/39720_new_0_1.html" class="aLightGray" title="asyncio">asyncio</a> · <a href="javascript:;" class="aLightGray" title="CancelledError">CancelledError</a> <a href="javascript:;" class="aLightGray" title="结构化并发">结构化并发</a> <a href="javascript:;" class="aLightGray" title="ExceptionGroup">ExceptionGroup</a> <a href="javascript:;" class="aLightGray" title="Python asyncio TaskGroup">Python asyncio TaskGroup</a> <a href="javascript:;" class="aLightGray" title="asyncio gather">asyncio gather</a> </span> </dd> <dt class="lineOverflow"> <a href="/article/630019.html" class="aBlack" target="_blank" title="asyncio TaskGroup 让并发任务在首错时一起收敛">asyncio TaskGroup 让并发任务在首错时一起收敛</a> </dt> <dd class="cont2"> <span><i class="view"></i>246浏览</span> <span class="collectBtn user_collection" data-id="630019" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> <li> <div class="contBox"> <a href="/article/629994.html" class="img_box" title="Python 3.14 自由线程程序怎样显式保护共享状态"> <img src="/uploads/20261007/1791315151-4aff7c1abd-48944f20bb-cover-640.webp" onerror="this.src='/assets/images/moren/morentu.png'" alt="Python 3.14 自由线程程序怎样显式保护共享状态"> </a> <dl> <dd class="cont1"> <span> <a href="/articlelist/19_new_0_1.html" class="aLightGray" title="文章">文章</a> · <a href="/articlelist/86_new_0_1.html" class="aLightGray" title="python教程">python教程</a>   |  1天前  |   </span> </dd> <dt class="lineOverflow"> <a href="/article/629994.html" class="aBlack" target="_blank" title="Python 3.14 自由线程程序怎样显式保护共享状态">Python 3.14 自由线程程序怎样显式保护共享状态</a> </dt> <dd class="cont2"> <span><i class="view"></i>337浏览</span> <span class="collectBtn user_collection" data-id="629994" data-type="article" title="收藏"><i class="collect"></i>收藏</span> </dd> </dl> </div> </li> </ul> </div> </div> <div class="mainRight"> <!-- 右侧广告位banner --> <div class="rightContBox" style="margin-top: 0px;"> <div class="rightTit"> <a href="/courselist.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit lineOverflow">课程推荐</div> </div> <ul class="lessonRecomRList"> <li> <a href="/course/9.html" class="img_box" target="_blank" title="前端进阶之JavaScript设计模式"> <img src="/uploads/20221222/52fd0f23a454c71029c2c72d206ed815.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="前端进阶之JavaScript设计模式"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/9.html" target="_blank" class="aBlack" title="前端进阶之JavaScript设计模式">前端进阶之JavaScript设计模式</a></dt> <dd class="cont1 lineTwoOverflow"> 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。 </dd> <dd class="cont2">543次学习</dd> </dl> </li> <li> <a href="/course/2.html" class="img_box" target="_blank" title="GO语言核心编程课程"> <img src="/uploads/20221221/634ad7404159bfefc6a54a564d437b5f.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="GO语言核心编程课程"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/2.html" target="_blank" class="aBlack" title="GO语言核心编程课程">GO语言核心编程课程</a></dt> <dd class="cont1 lineTwoOverflow"> 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。 </dd> <dd class="cont2">516次学习</dd> </dl> </li> <li> <a href="/course/74.html" class="img_box" target="_blank" title="简单聊聊mysql8与网络通信"> <img src="/uploads/20240103/bad35fe14edbd214bee16f88343ac57c.png" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="简单聊聊mysql8与网络通信"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/74.html" target="_blank" class="aBlack" title="简单聊聊mysql8与网络通信">简单聊聊mysql8与网络通信</a></dt> <dd class="cont1 lineTwoOverflow"> 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让 </dd> <dd class="cont2">500次学习</dd> </dl> </li> <li> <a href="/course/57.html" class="img_box" target="_blank" title="JavaScript正则表达式基础与实战"> <img src="/uploads/20221226/bbe4083bb3cb0dd135fb02c31c3785fb.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="JavaScript正则表达式基础与实战"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/57.html" target="_blank" class="aBlack" title="JavaScript正则表达式基础与实战">JavaScript正则表达式基础与实战</a></dt> <dd class="cont1 lineTwoOverflow"> 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。 </dd> <dd class="cont2">487次学习</dd> </dl> </li> <li> <a href="/course/28.html" class="img_box" target="_blank" title="从零制作响应式网站—Grid布局"> <img src="/uploads/20221223/ac110f88206daeab6c0cf38ebf5fe9ed.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="从零制作响应式网站—Grid布局"> </a> <dl> <dt class="lineTwoOverflow"><a href="/course/28.html" target="_blank" class="aBlack" title="从零制作响应式网站—Grid布局">从零制作响应式网站—Grid布局</a></dt> <dd class="cont1 lineTwoOverflow"> 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。 </dd> <dd class="cont2">485次学习</dd> </dl> </li> </ul> </div> <div class="rightContBox"> <div class="rightTit"> <a href="/ai.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit lineOverflow">AI推荐</div> </div> <ul class="lessonRecomRList"> <li> <a href="/ai/13900.html" target="_blank" title="PubMedQA数据集详解:生物医学问答基准、功能与应用指南" class="img_box"> <img src="/uploads/20260908/6a9f83280940e7.65575695.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="PubMedQA数据集详解:生物医学问答基准、功能与应用指南" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13900.html" class="aBlack" target="_blank" title="PubMedQA">PubMedQA</a></dt> <dd class="cont1 lineTwoOverflow"> 深入了解PubMedQA生物医学问答数据集,涵盖其核心功能、使用方法及在临床决策、药物研发等场景的应用,助力提升NLP模型性能。 </dd> <dd class="cont2">379次使用</dd> </dl> </li> <li> <a href="/ai/13899.html" target="_blank" title="H2O EvalGPT:开源LLM大模型评估与排行榜工具" class="img_box"> <img src="/uploads/20260908/17887986376a9ee6adaf3f5.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="H2O EvalGPT:开源LLM大模型评估与排行榜工具" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13899.html" class="aBlack" target="_blank" title="H2O EvalGPT">H2O EvalGPT</a></dt> <dd class="cont1 lineTwoOverflow"> H2O EvalGPT是H2O.ai推出的开源LLM评估平台,提供详细的大模型性能排行榜、行业特定基准测试及A/B测试功能,助您快速选择最适合项目的高性能大语言模型。 </dd> <dd class="cont2">450次使用</dd> </dl> </li> <li> <a href="/ai/13898.html" target="_blank" title="LMArena是什么?伯克利AI模型评估平台使用指南与功能解析" class="img_box"> <img src="/uploads/20260908/6a9f862dbcfec7.27385604.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="LMArena是什么?伯克利AI模型评估平台使用指南与功能解析" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13898.html" class="aBlack" target="_blank" title="LMArena">LMArena</a></dt> <dd class="cont1 lineTwoOverflow"> LMArena是加州大学伯克利分校推出的AI模型匿名评测平台。通过盲测投票机制,用户可对比不同大模型回答并生成实时排行榜,助力开发者优化模型及用户选择最佳AI工具。 </dd> <dd class="cont2">459次使用</dd> </dl> </li> <li> <a href="/ai/13897.html" target="_blank" title="斯坦福HELM:大语言模型Holistic Evaluation整体评估框架详解" class="img_box"> <img src="/uploads/20260908/6a9f86b31ed789.06773114.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="斯坦福HELM:大语言模型Holistic Evaluation整体评估框架详解" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13897.html" class="aBlack" target="_blank" title="HELM">HELM</a></dt> <dd class="cont1 lineTwoOverflow"> 深入了解斯坦福推出的HELM(Holistic Evaluation of Language Models)大模型评测体系。本文解析其核心功能、安装配置步骤及应用场景,涵盖准确性、公平性、鲁棒性等多维度指标,助力开发者全面优化语言模型性能。 </dd> <dd class="cont2">402次使用</dd> </dl> </li> <li> <a href="/ai/13896.html" target="_blank" title="MMBench详解:多模态大模型基准测试、功能特点与使用指南" class="img_box"> <img src="/uploads/20260908/6a9f86d3eed3e7.18564236.jpg" onerror="this.onerror='',this.src='/assets/images/moren/morentu.png'" alt="MMBench详解:多模态大模型基准测试、功能特点与使用指南" style="object-fit:cover;width:100%;height:100%;"> </a> <dl> <dt class="lineTwoOverflow"><a href="/ai/13896.html" class="aBlack" target="_blank" title="MMBench">MMBench</a></dt> <dd class="cont1 lineTwoOverflow"> MMBench是由上海人工智能实验室等机构联合推出的多模态基准测试平台,提供细粒度能力评估、大规模数据集及VLMEvalKit工具。本文详细介绍其核心功能、安装使用方法及应用场景,助力开发者全面评估多模态模型性能。 </dd> <dd class="cont2">230次使用</dd> </dl> </li> </ul> </div> <!-- 相关文章 --> <div class="rightContBox"> <div class="rightTit"> <a href="/articlelist.html" class="more" title="查看更多">查看更多<i class="iconfont"></i></a> <div class="tit lineOverflow">相关文章</div> </div> <ul class="aboutArticleRList"> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/622385.html" class="aBlack" title="Python sqlite3 Connection serialize 怎么导出数据库快照:备份窗口、内存占用与恢复校验">Python sqlite3 Connection serialize 怎么导出数据库快照:备份窗口、内存占用与恢复校验</a></dt> <dd> <span class="left">2026-08-26</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/616032.html" class="aBlack" title="Python监控网页状态:requests异常处理实战">Python监控网页状态:requests异常处理实战</a></dt> <dd> <span class="left">2026-05-29</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/612350.html" class="aBlack" title="TensorFlow模型部署为API的TF Serving方法">TensorFlow模型部署为API的TF Serving方法</a></dt> <dd> <span class="left">2026-05-26</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/602477.html" class="aBlack" title="Python字符串编码转换:encode与decode详解">Python字符串编码转换:encode与decode详解</a></dt> <dd> <span class="left">2026-05-16</span> <span class="right">501浏览</span> </dd> </dl> </li> <li> <dl> <dt class="lineTwoOverflow"><a href="/article/602019.html" class="aBlack" title="TensorFlow裁剪无用算子方法详解">TensorFlow裁剪无用算子方法详解</a></dt> <dd> <span class="left">2026-05-15</span> <span class="right">501浏览</span> </dd> </dl> </li> </ul> </div> </div> </div> <div class="footer"> <div class="footerIn"> <div class="footLeft"> <div class="linkBox"> <a href="/about/1.html" target="_blank" class="aBlack" title="关于我们">关于我们</a> <a href="/about/5.html" target="_blank" class="aBlack" title="免责声明">免责声明</a> <a href="#" class="aBlack" title="意见反馈">意见反馈</a> <a href="/about/2.html" class="aBlack" target="_blank" title="联系我们">联系我们</a> <a href="/send.html" class="aBlack" title="广告合作">内容提交</a> <a href="/manual/go/" target="_blank" class="aBlack" title="手册">手册</a> </div> <div class="footTip">Golang学习网:公益在线Go学习平台,帮助Go学习者快速成长!</div> <div class="shareBox"> <span><i class="qq"></i>技术交流群</span> </div> <div class="copyRight"> Copyright 2023 http://www.17golang.com/ All Rights Reserved | <a href="https://beian.miit.gov.cn/" target="_blank" title="备案">湘ICP备19018815号-4</a> </div> </div> <div class="footRight"> <ul class="encodeList"> <li> <div class="encodeImg"> <img src="/assets/examples/qrcode_for_gh.jpg" alt="Golang学习网"> </div> <div class="tit">关注公众号</div> <div class="tip">Golang学习网</div> </li> <div class="clear"></div> </ul> </div> <div class="clear"></div> </div> </div> <!-- 微信登录弹窗 --> <style> .popupBg .n-error{ color: red; } </style> <div class="popupBg"> <div class="loginBoxBox"> <div class="imgbg"> <img src="/assets/images/leftlogo.jpg" alt=""> </div> <!-- 微信登录 --> <div class="loginInfo encodeLogin" style="display: none;"> <div class="closeIcon" onclick="$('.popupBg').hide();"></div> <div class="changeLoginType cursorPointer create_wxqrcode" onclick="$('.loginInfo').hide();$('.passwordLogin').show();"> <div class="tip">密码登录在这里</div> </div> <div class="encodeInfo"> <div class="tit"><i></i> 微信扫码登录或注册</div> <div class="encodeImg"> <span id="wx_login_qrcode"><img src="/assets/examples/code.png" alt="二维码"></span> <!-- <div class="refreshBox"> <p>二维码失效</p> <button type="button" class="create_wxqrcode">刷新1111</button> </div> --> </div> <div class="tip">打开微信扫一扫,快速登录/注册</div> </div> <div class="beforeLoginTip">登录即同意 <a href="#" class="aBlue" title="用户协议">用户协议</a> 和 <a href="#" class="aBlue" title="隐私政策">隐私政策</a></div> </div> <!-- 密码登录 --> <div class="loginInfo passwordLogin"> <div class="closeIcon" onclick="$('.popupBg').hide();"></div> <div class="changeLoginType cursorPointer create_wxqrcode" onclick="$('.loginInfo').hide();$('.encodeLogin').show();"> <div class="tip">微信登录更方便</div> </div> <div class="passwordInfo"> <ul class="logintabs selfTabMenu"> <li class="selfTabItem loginFormLi curr">密码登录</li> <li class="selfTabItem registerFormBox ">注册账号</li> </ul> <div class="selfTabContBox"> <div class="selfTabCont loginFormBox" style="display: block;"> <form name="form" id="login-form" class="form-vertical form" method="POST" action="/index/user/login"> <input type="hidden" name="url" value="//www.17golang.com/article/425166.html"/> <input type="hidden" name="__token__" value="c1f24f23a057f180567e03f1101709cf" /> <div class="form-group" style="height:70px;"> <input class="form-control" id="account" type="text" name="account" value="" data-rule="required" placeholder="邮箱/用户名" autocomplete="off"> </div> <div class="form-group" style="height:70px;"> <input class="form-control" id="password" type="password" name="password" data-rule="required;password" placeholder="密码" autocomplete="off"> </div> <div class="codeBox" style="height:70px;"> <div class="form-group" style="height:70px; width:205px; float: left;"> <input type="text" name="captcha" class="form-control" placeholder="验证码" data-rule="required;length(4)" /> </div> <span class="input-group-btn" style="padding:0;border:none;"> <img src="/captcha.html" width="100" height="45" onclick="this.src = '/captcha.html?r=' + Math.random();"/> </span> </div> <div class="other"> <a href="#" class="forgetPwd aGray" onclick="$('.loginInfo').hide();$('.passwordForget').show();" title="忘记密码">忘记密码</a> </div> <div class="loginBtn mt25"> <button type="submit">登录</button> </div> </form> </div> <div class="selfTabCont registerFormBox" style="display: none;"> <form name="form1" id="register-form" class="form-vertical form" method="POST" action="/index/user/register"> <input type="hidden" name="invite_user_id" value="0"/> <input type="hidden" name="url" value="//www.17golang.com/article/425166.html"/> <input type="hidden" name="__token__" value="c1f24f23a057f180567e03f1101709cf" /> <div class="form-group" style="height:70px;"> <input type="text" name="email" id="email2" data-rule="required;email" class="form-control" placeholder="邮箱"> </div> <div class="form-group" style="height:70px;"> <input type="text" id="username" name="username" data-rule="required;username" class="form-control" placeholder="用户名必须3-30个字符"> </div> <div class="form-group" style="height:70px;"> <input type="password" id="password2" name="password" data-rule="required;password" class="form-control" placeholder="密码必须6-30个字符"> </div> <div class="codeBox" style="height:70px;"> <div class="form-group" style="height:70px; width:205px; float: left;"> <input type="text" name="captcha" class="form-control" placeholder="验证码" data-rule="required;length(4)" /> </div> <span class="input-group-btn" style="padding:0;border:none;"> <img src="/captcha.html" width="100" height="45" onclick="this.src = '/captcha.html?r=' + Math.random();"/> </span> </div> <div class="loginBtn"> <button type="submit">注册</button> </div> </form> </div> </div> </div> <div class="beforeLoginTip">登录即同意 <a href="https://www.17golang.com/about/3.html" target="_blank" class="aBlue" title="用户协议">用户协议</a> 和 <a href="https://www.17golang.com/about/4.html" target="_blank" class="aBlue" title="隐私政策">隐私政策</a></div> </div> <!-- 重置密码 --> <div class="loginInfo passwordForget"> <div class="closeIcon" onclick="$('.popupBg').hide();"></div> <div class="returnLogin cursorPointer" onclick="$('.passwordForget').hide();$('.passwordLogin').show();">返回登录</div> <div class="passwordInfo"> <ul class="logintabs selfTabMenu"> <li class="selfTabItem">重置密码</li> </ul> <div class="selfTabContBox"> <div class="selfTabCont"> <form id="resetpwd-form" class="form-horizontal form-layer nice-validator n-default n-bootstrap form" method="POST" action="/api/user/resetpwd.html" novalidate="novalidate"> <div style="height:70px;"> <input type="text" class="form-control" id="email" name="email" value="" placeholder="输入邮箱" aria-invalid="true"> </div> <div class="codeBox" style="height:70px;"> <div class="form-group" style="height:70px; width:205px; float: left;"> <input type="text" name="captcha" class="form-control" placeholder="验证码" /> </div> <span class="input-group-btn" style="padding:0;border:none;"> <a href="javascript:;" class="btn btn-primary btn-captcha cursorPointer" style="background: #2080F8; border-radius: 4px; color: #fff; padding: 12px; position: absolute;" data-url="/api/ems/send.html" data-type="email" data-event="resetpwd">发送验证码</a> </span> </div> <input type="password" class="form-control" id="newpassword" name="newpassword" value="" placeholder="请输入6-18位密码"> <div class="loginBtn mt25"> <button type="submit">重置密码</button> </div> </form> </div> </div> </div> </div> </div> </div> <script src="/assets/js/juejin-theme.js?v=20260613b" defer></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?e34c3e8ab31ba35d7e1c48ea8d77315f"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script src="/assets/js/frontend/common.js"></script> </body> </html>