{"id":942934,"date":"2024-12-26T22:23:23","date_gmt":"2024-12-26T14:23:23","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/942934.html"},"modified":"2024-12-26T22:23:25","modified_gmt":"2024-12-26T14:23:25","slug":"python%e5%a6%82%e4%bd%95%e7%94%9f%e6%88%90html","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/942934.html","title":{"rendered":"python\u5982\u4f55\u751f\u6210html"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25080540\/a4a2c51d-1707-462d-9dc2-039ec2da7970.webp\" alt=\"python\u5982\u4f55\u751f\u6210html\" \/><\/p>\n<p><p> <strong>Python\u751f\u6210HTML\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u5b57\u7b26\u4e32\u64cd\u4f5c\u3001\u6a21\u677f\u5f15\u64ce\uff08\u5982Jinja2\uff09\u3001\u6846\u67b6\uff08\u5982Flask\u3001Django\uff09\u7b49\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u901a\u8fc7\u6a21\u677f\u5f15\u64ce\u751f\u6210\u52a8\u6001HTML\u3001\u4f7f\u7528\u5185\u7f6e\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\u751f\u6210\u7b80\u5355\u7684\u9759\u6001HTML\u3002<\/strong>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528Python\u751f\u6210HTML\uff0c\u5305\u62ec\u5404\u79cd\u65b9\u6cd5\u7684\u4f18\u7f3a\u70b9\u53ca\u5176\u4f7f\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u5b57\u7b26\u4e32\u64cd\u4f5c\u751f\u6210HTML<\/p>\n<\/p>\n<p><p>\u901a\u8fc7Python\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u6784\u5efaHTML\u4ee3\u7801\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u7b80\u5355\u548c\u9759\u6001\u7684HTML\u9875\u9762\u3002<\/p>\n<\/p>\n<ol>\n<li>\u57fa\u672c\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c<\/li>\n<\/ol>\n<p><p>Python\u7684\u5b57\u7b26\u4e32\u683c\u5f0f\u5316\u529f\u80fd\u53ef\u4ee5\u7528\u6765\u63d2\u5165\u52a8\u6001\u5185\u5bb9\u5230HTML\u6a21\u677f\u4e2d\u3002\u53ef\u4ee5\u4f7f\u7528\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u6216\u8005f-string\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">title = &quot;Hello, World!&quot;<\/p>\n<p>body = &quot;This is a simple HTML page.&quot;<\/p>\n<p>html = f&quot;&quot;&quot;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;{title}&lt;\/title&gt;&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h1&gt;{title}&lt;\/h1&gt;<\/p>\n<p>&lt;p&gt;{body}&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&quot;&quot;&quot;<\/p>\n<p>print(html)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u7b80\u5355\u76f4\u63a5\uff0c\u4f46\u5bf9\u4e8e\u590d\u6742\u7684HTML\u9875\u9762\u53ef\u80fd\u4f1a\u53d8\u5f97\u96be\u4ee5\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u62fc\u63a5HTML\u7247\u6bb5<\/li>\n<\/ol>\n<p><p>\u5982\u679c\u9875\u9762\u8f83\u4e3a\u590d\u6742\uff0c\u53ef\u4ee5\u8003\u8651\u5c06HTML\u7247\u6bb5\u5206\u5f00\u5b9a\u4e49\uff0c\u7136\u540e\u901a\u8fc7\u5b57\u7b26\u4e32\u62fc\u63a5\u7684\u65b9\u6cd5\u7ec4\u5408\u6210\u5b8c\u6574\u7684HTML\u9875\u9762\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">header = &quot;&lt;head&gt;&lt;title&gt;Page Title&lt;\/title&gt;&lt;\/head&gt;&quot;<\/p>\n<p>body = &quot;&lt;body&gt;&lt;h1&gt;Page Header&lt;\/h1&gt;&lt;p&gt;Page content goes here.&lt;\/p&gt;&lt;\/body&gt;&quot;<\/p>\n<p>html = f&quot;&lt;html&gt;{header}{body}&lt;\/html&gt;&quot;<\/p>\n<p>print(html)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u6837\u505a\u7684\u4f18\u70b9\u662f\u6e05\u6670\u660e\u786e\uff0c\u4f46\u7f3a\u70b9\u662f\u4ee3\u7801\u5bb9\u6613\u53d8\u5f97\u6742\u4e71\u65e0\u7ae0\uff0c\u4e0d\u6613\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528\u6a21\u677f\u5f15\u64ce\u751f\u6210HTML<\/p>\n<\/p>\n<p><p>\u6a21\u677f\u5f15\u64ce\u662f\u751f\u6210HTML\u7684\u6700\u4f73\u5b9e\u8df5\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u52a8\u6001\u5185\u5bb9\u548c\u590d\u6742\u9875\u9762\u3002Jinja2\u662fPython\u4e2d\u6700\u6d41\u884c\u7684\u6a21\u677f\u5f15\u64ce\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Jinja2<\/li>\n<\/ol>\n<p><p>\u9996\u5148\u9700\u8981\u5b89\u88c5Jinja2\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install Jinja2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Jinja2\u751f\u6210HTML<\/li>\n<\/ol>\n<p><p>Jinja2\u5141\u8bb8\u4f60\u5c06HTML\u6a21\u677f\u4e0ePython\u7684\u6570\u636e\u7ed3\u5408\uff0c\u751f\u6210\u52a8\u6001\u7684HTML\u9875\u9762\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from jinja2 import Template<\/p>\n<p>template = Template(&#39;&#39;&#39;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;{{ title }}&lt;\/title&gt;&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h1&gt;{{ header }}&lt;\/h1&gt;<\/p>\n<p>&lt;p&gt;{{ body }}&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p>&#39;&#39;&#39;)<\/p>\n<p>data = {<\/p>\n<p>    &#39;title&#39;: &#39;Sample Page&#39;,<\/p>\n<p>    &#39;header&#39;: &#39;Welcome to My Page&#39;,<\/p>\n<p>    &#39;body&#39;: &#39;This is an example of a simple HTML page generated using Jinja2.&#39;<\/p>\n<p>}<\/p>\n<p>html = template.render(data)<\/p>\n<p>print(html)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>Jinja2\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u6e05\u6670\u7684\u8bed\u6cd5\u548c\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u7279\u522b\u9002\u5408\u7528\u4e8e\u751f\u6210\u590d\u6742\u7684HTML\u9875\u9762\u548c\u5904\u7406\u52a8\u6001\u6570\u636e\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528Web\u6846\u67b6\u751f\u6210HTML<\/p>\n<\/p>\n<p><p>Python\u4e2d\u7684Web\u6846\u67b6\u5982Flask\u548cDjango\u90fd\u5185\u7f6e\u652f\u6301\u6a21\u677f\u5f15\u64ce\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u751f\u6210HTML\u9875\u9762\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528Flask\u751f\u6210HTML<\/li>\n<\/ol>\n<p><p>Flask\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u6846\u67b6\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u5c0f\u578b\u548c\u4e2d\u578bWeb\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask, render_template_string<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/&#39;)<\/p>\n<p>def home():<\/p>\n<p>    title = &quot;Flask Page&quot;<\/p>\n<p>    header = &quot;Hello, Flask!&quot;<\/p>\n<p>    body = &quot;This page is generated using Flask.&quot;<\/p>\n<p>    html = &#39;&#39;&#39;<\/p>\n<p>    &lt;html&gt;<\/p>\n<p>    &lt;head&gt;&lt;title&gt;{{ title }}&lt;\/title&gt;&lt;\/head&gt;<\/p>\n<p>    &lt;body&gt;<\/p>\n<p>    &lt;h1&gt;{{ header }}&lt;\/h1&gt;<\/p>\n<p>    &lt;p&gt;{{ body }}&lt;\/p&gt;<\/p>\n<p>    &lt;\/body&gt;<\/p>\n<p>    &lt;\/html&gt;<\/p>\n<p>    &#39;&#39;&#39;<\/p>\n<p>    return render_template_string(html, title=title, header=header, body=body)<\/p>\n<p>if __name__ == &#39;__m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n__&#39;:<\/p>\n<p>    app.run(debug=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728Flask\u4e2d\uff0c\u901a\u5e38\u4f1a\u5c06HTML\u6a21\u677f\u653e\u5728<code>templates<\/code>\u76ee\u5f55\u4e2d\uff0c\u4f7f\u7528<code>render_template<\/code>\u51fd\u6570\u52a0\u8f7d\u6a21\u677f\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528Django\u751f\u6210HTML<\/li>\n<\/ol>\n<p><p>Django\u662f\u4e00\u4e2a\u529f\u80fd\u5168\u9762\u7684Web\u6846\u67b6\uff0c\u9002\u5408\u5927\u578b\u5e94\u7528\u5f00\u53d1\u3002Django\u4f7f\u7528\u81ea\u5df1\u7684\u6a21\u677f\u5f15\u64ce\uff0c\u8bed\u6cd5\u4e0eJinja2\u7c7b\u4f3c\u3002<\/p>\n<\/p>\n<p><p>\u5728Django\u4e2d\uff0c\u4f60\u53ef\u4ee5\u5728<code>templates<\/code>\u76ee\u5f55\u4e0b\u521b\u5efaHTML\u6587\u4ef6\uff0c\u7136\u540e\u901a\u8fc7\u89c6\u56fe\u51fd\u6570\u6e32\u67d3\u8fd9\u4e9b\u6a21\u677f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!-- templates\/index.html --&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;{{ title }}&lt;\/title&gt;&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h1&gt;{{ header }}&lt;\/h1&gt;<\/p>\n<p>&lt;p&gt;{{ body }}&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><pre><code class=\"language-python\"># views.py<\/p>\n<p>from django.shortcuts import render<\/p>\n<p>def index(request):<\/p>\n<p>    context = {<\/p>\n<p>        &#39;title&#39;: &#39;Django Page&#39;,<\/p>\n<p>        &#39;header&#39;: &#39;Hello, Django!&#39;,<\/p>\n<p>        &#39;body&#39;: &#39;This page is generated using Django.&#39;<\/p>\n<p>    }<\/p>\n<p>    return render(request, &#39;index.html&#39;, context)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528Web\u6846\u67b6\u7684\u597d\u5904\u662f\u53ef\u4ee5\u66f4\u597d\u5730\u7ec4\u7ec7\u4ee3\u7801\uff0c\u5904\u7406\u590d\u6742\u7684\u903b\u8f91\uff0c\u9002\u5408\u4e8e\u5f00\u53d1\u548c\u7ef4\u62a4\u5927\u578b\u7684Web\u5e94\u7528\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u751f\u6210HTML<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u6a21\u677f\u5f15\u64ce\u548c\u6846\u67b6\uff0c\u8fd8\u6709\u4e00\u4e9b\u7b2c\u4e09\u65b9\u5e93\u53ef\u4ee5\u5e2e\u52a9\u751f\u6210HTML\uff0c\u4f8b\u5982yattag\u548cdominate\u3002\u8fd9\u4e9b\u5e93\u63d0\u4f9b\u4e86\u66f4\u9ad8\u5c42\u6b21\u7684\u62bd\u8c61\uff0c\u9002\u5408\u4e8e\u751f\u6210\u590d\u6742\u7684HTML\u7ed3\u6784\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4f7f\u7528yattag\u751f\u6210HTML<\/li>\n<\/ol>\n<p><p>yattag\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684HTML\u751f\u6210\u5e93\uff0c\u4f7f\u7528\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668\u7684\u8bed\u6cd5\u751f\u6210HTML\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from yattag import Doc<\/p>\n<p>doc, tag, text = Doc().tagtext()<\/p>\n<p>with tag(&#39;html&#39;):<\/p>\n<p>    with tag(&#39;head&#39;):<\/p>\n<p>        with tag(&#39;title&#39;):<\/p>\n<p>            text(&#39;Yattag Page&#39;)<\/p>\n<p>    with tag(&#39;body&#39;):<\/p>\n<p>        with tag(&#39;h1&#39;):<\/p>\n<p>            text(&#39;Hello, Yattag!&#39;)<\/p>\n<p>        with tag(&#39;p&#39;):<\/p>\n<p>            text(&#39;This page is generated using yattag.&#39;)<\/p>\n<p>html = doc.getvalue()<\/p>\n<p>print(html)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528dominate\u751f\u6210HTML<\/li>\n<\/ol>\n<p><p>dominate\u662f\u53e6\u4e00\u4e2a\u7528\u4e8e\u751f\u6210HTML\u7684\u5e93\uff0c\u63d0\u4f9b\u4e86\u7c7b\u4f3c\u4e8eJavaScript\u7684DOM\u64cd\u4f5c\u63a5\u53e3\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from dominate.tags import html, head, title, body, h1, p<\/p>\n<p>doc = html()<\/p>\n<p>with doc:<\/p>\n<p>    with head():<\/p>\n<p>        title(&#39;Dominate Page&#39;)<\/p>\n<p>    with body():<\/p>\n<p>        h1(&#39;Hello, Dominate!&#39;)<\/p>\n<p>        p(&#39;This page is generated using dominate.&#39;)<\/p>\n<p>html = doc.render()<\/p>\n<p>print(html)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u7b2c\u4e09\u65b9\u5e93\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u7b80\u6d01\u7684\u8bed\u6cd5\u548c\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u9002\u5408\u4e8e\u9700\u8981\u751f\u6210\u590d\u6742HTML\u7ed3\u6784\u7684\u5e94\u7528\u573a\u666f\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u603b\u7ed3<\/p>\n<\/p>\n<p><p>Python\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u751f\u6210HTML\uff0c\u4ece\u7b80\u5355\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\u5230\u529f\u80fd\u5f3a\u5927\u7684\u6a21\u677f\u5f15\u64ce\u548cWeb\u6846\u67b6\uff0c\u4ee5\u53ca\u4e13\u7528\u7684HTML\u751f\u6210\u5e93\u3002\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u53d6\u51b3\u4e8e\u5e94\u7528\u7684\u590d\u6742\u6027\u548c\u5f00\u53d1\u9700\u6c42\u3002\u5bf9\u4e8e\u7b80\u5355\u7684\u9759\u6001\u9875\u9762\uff0c\u5b57\u7b26\u4e32\u64cd\u4f5c\u53ef\u80fd\u8db3\u591f\uff1b\u5bf9\u4e8e\u52a8\u6001\u548c\u590d\u6742\u7684\u9875\u9762\uff0c\u6a21\u677f\u5f15\u64ce\u548cWeb\u6846\u67b6\u662f\u66f4\u597d\u7684\u9009\u62e9\uff1b\u800c\u5bf9\u4e8e\u9700\u8981\u751f\u6210\u590d\u6742HTML\u7ed3\u6784\u7684\u5e94\u7528\uff0c\u7b2c\u4e09\u65b9\u5e93\u5982yattag\u548cdominate\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>Python\u53ef\u4ee5\u751f\u6210HTML\u6587\u4ef6\u7684\u5e38\u7528\u65b9\u6cd5\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>Python\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u751f\u6210HTML\u6587\u4ef6\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u7684\u5b57\u7b26\u4e32\u64cd\u4f5c\u3001\u6a21\u677f\u5f15\u64ce\uff08\u5982Jinja2\uff09\u3001\u4ee5\u53caWeb\u6846\u67b6\uff08\u5982Flask\u548cDjango\uff09\u3002\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u52a8\u6001\u521b\u5efaHTML\u5185\u5bb9\uff0c\u5229\u7528Python\u7684\u903b\u8f91\u5904\u7406\u80fd\u529b\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u751f\u6210HTML\u65f6\uff0c\u6709\u54ea\u4e9b\u63a8\u8350\u7684\u5e93\u6216\u5de5\u5177\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5e93\u6765\u751f\u6210HTML\u3002\u4f8b\u5982\uff0cJinja2\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6a21\u677f\u5f15\u64ce\uff0c\u9002\u5408\u4e8e\u751f\u6210\u590d\u6742\u7684HTML\u7ed3\u6784\u3002\u53e6\u4e00\u4e2a\u9009\u62e9\u662fBeautiful Soup\uff0c\u867d\u7136\u5b83\u4e3b\u8981\u7528\u4e8e\u89e3\u6790HTML\uff0c\u4f46\u4e5f\u53ef\u4ee5\u7528\u4e8e\u751f\u6210\u548c\u4fee\u6539HTML\u5185\u5bb9\u3002\u6b64\u5916\uff0cFlask\u548cDjango\u7b49Web\u6846\u67b6\u672c\u8eab\u4e5f\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u6a21\u677f\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8f7b\u677e\u751f\u6210\u52a8\u6001HTML\u3002<\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528Python\u751f\u6210\u5e26\u6709CSS\u6837\u5f0f\u7684HTML\u9875\u9762\uff1f<\/strong><br \/>\u8981\u751f\u6210\u5e26\u6709CSS\u6837\u5f0f\u7684HTML\u9875\u9762\uff0c\u53ef\u4ee5\u5728\u751f\u6210\u7684HTML\u4e2d\u5d4c\u5165<\/p>\n<style>\u6807\u7b7e\uff0c\u6216\u8005\u5f15\u7528\u5916\u90e8CSS\u6587\u4ef6\u3002\u901a\u8fc7Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u52a8\u6001\u521b\u5efa\u5305\u542b<\/p>\n<style>\u6807\u7b7e\u7684HTML\u5b57\u7b26\u4e32\uff0c\u6216\u5728<head>\u90e8\u5206\u6dfb\u52a0<link>\u6807\u7b7e\u6765\u94fe\u63a5\u5916\u90e8CSS\u6587\u4ef6\u3002\u8fd9\u6837\uff0c\u751f\u6210\u7684HTML\u9875\u9762\u5c31\u53ef\u4ee5\u5e94\u7528\u6240\u9700\u7684\u6837\u5f0f\uff0c\u4ece\u800c\u63d0\u5347\u9875\u9762\u7684\u89c6\u89c9\u6548\u679c\u548c\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u751f\u6210HTML\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u5185\u7f6e\u5b57\u7b26\u4e32\u64cd\u4f5c\u3001\u6a21\u677f\u5f15\u64ce\uff08\u5982Jinja2\uff09\u3001\u6846\u67b6\uff08\u5982Flask\u3001 [&hellip;]","protected":false},"author":3,"featured_media":942935,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/942934"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=942934"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/942934\/revisions"}],"predecessor-version":[{"id":942936,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/942934\/revisions\/942936"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/942935"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=942934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=942934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=942934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}