{"id":1013806,"date":"2024-12-27T11:51:00","date_gmt":"2024-12-27T03:51:00","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1013806.html"},"modified":"2024-12-27T11:51:02","modified_gmt":"2024-12-27T03:51:02","slug":"html%e5%a6%82%e4%bd%95%e4%b8%8epython%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1013806.html","title":{"rendered":"html\u5982\u4f55\u4e0epython\u4f7f\u7528"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25094115\/243908f6-8525-4630-9dba-4e8396f1a5aa.webp\" alt=\"html\u5982\u4f55\u4e0epython\u4f7f\u7528\" \/><\/p>\n<p><p> <strong>HTML\u4e0ePython\u7684\u7ed3\u5408\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528Web\u6846\u67b6\uff08\u5982Flask\u548cDjango\uff09\u3001\u901a\u8fc7CGI\uff08Common Gateway Interface\uff09\u811a\u672c\u3001\u4ee5\u53ca\u901a\u8fc7API\u7b49\u65b9\u5f0f\u3002\u4f7f\u7528Web\u6846\u67b6\u662f\u76ee\u524d\u6700\u6d41\u884c\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u4eec\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\u6765\u5904\u7406HTTP\u8bf7\u6c42\u3001\u8def\u7531\u3001\u6a21\u677f\u6e32\u67d3\u7b49\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4f7f\u7528Flask\u6846\u67b6\u4e0eHTML\u7ed3\u5408\u7684\u8fc7\u7a0b\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001WEB\u6846\u67b6\uff1aFLASK<\/p>\n<\/p>\n<p><p>Flask\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Python Web\u6846\u67b6\uff0c\u9002\u5408\u4e8e\u6784\u5efa\u5c0f\u578b\u5e94\u7528\u548c\u5feb\u901f\u5f00\u53d1\u3002\u5b83\u901a\u8fc7\u8def\u7531\u5c06HTTP\u8bf7\u6c42\u6620\u5c04\u5230Python\u51fd\u6570\uff0c\u5e76\u901a\u8fc7\u6a21\u677f\u5f15\u64ce\u5c06\u52a8\u6001\u5185\u5bb9\u5d4c\u5165\u5230HTML\u4e2d\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Flask\u5b89\u88c5\u4e0e\u57fa\u672c\u8bbe\u7f6e<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u5f00\u59cb\u4f7f\u7528Flask\uff0c\u9996\u5148\u9700\u8981\u5728\u4f60\u7684Python\u73af\u5883\u4e2d\u5b89\u88c5\u5b83\u3002\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install flask<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u57fa\u672c\u7684Flask\u5e94\u7528\u3002\u9996\u5148\uff0c\u521b\u5efa\u4e00\u4e2aPython\u6587\u4ef6\uff08\u4f8b\u5982app.py\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask, render_template<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/&#39;)<\/p>\n<p>def home():<\/p>\n<p>    return render_template(&#39;index.html&#39;)<\/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>\u5728\u8fd9\u4e2a\u7b80\u5355\u7684\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u6839\u8def\u7531\uff08<code>\/<\/code>\uff09\uff0c\u5f53\u8bbf\u95ee\u8fd9\u4e2a\u8def\u7531\u65f6\uff0cFlask\u4f1a\u6e32\u67d3<code>index.html<\/code>\u6a21\u677f\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efaHTML\u6a21\u677f<\/strong><\/p>\n<\/p>\n<p><p>\u5728Flask\u4e2d\uff0cHTML\u6587\u4ef6\u901a\u5e38\u5b58\u653e\u5728\u540d\u4e3a<code>templates<\/code>\u7684\u76ee\u5f55\u4e2d\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>index.html<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u653e\u7f6e\u5728<code>templates<\/code>\u76ee\u5f55\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;Flask App&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;Welcome to My Flask App&lt;\/h1&gt;<\/p>\n<p>    &lt;p&gt;This is a simple Flask application.&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u542f\u52a8Flask\u5e94\u7528\uff0c\u5bfc\u822a\u5230<code>http:\/\/localhost:5000\/<\/code>\uff0c\u4f60\u4f1a\u770b\u5230\u201cWelcome to My Flask App\u201d\u9875\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u52a8\u6001\u5185\u5bb9\u6e32\u67d3<\/strong><\/p>\n<\/p>\n<p><p>Flask\u7684\u5f3a\u5927\u4e4b\u5904\u5728\u4e8e\u53ef\u4ee5\u901a\u8fc7Jinja2\u6a21\u677f\u5f15\u64ce\u5b9e\u73b0\u52a8\u6001\u5185\u5bb9\u7684\u6e32\u67d3\u3002\u4f8b\u5982\uff0c\u5411HTML\u9875\u9762\u4f20\u9012\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">@app.route(&#39;\/user\/&lt;name&gt;&#39;)<\/p>\n<p>def user(name):<\/p>\n<p>    return render_template(&#39;user.html&#39;, name=name)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728<code>user.html<\/code>\u4e2d\uff0c\u4f7f\u7528Jinja2\u8bed\u6cd5\u6765\u63d2\u5165\u52a8\u6001\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;User Page&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;Hello, {{ name }}!&lt;\/h1&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8bbf\u95ee<code>http:\/\/localhost:5000\/user\/John<\/code>\uff0c\u9875\u9762\u5c06\u663e\u793a\u201cHello, John!\u201d\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001WEB\u6846\u67b6\uff1aDJANGO<\/p>\n<\/p>\n<p><p>Django\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Python Web\u6846\u67b6\uff0c\u9002\u5408\u4e8e\u6784\u5efa\u66f4\u590d\u6742\u548c\u5927\u578b\u7684\u5e94\u7528\u3002\u5b83\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u529f\u80fd\uff0c\u5982ORM\u3001\u7ba1\u7406\u540e\u53f0\u3001\u7528\u6237\u8ba4\u8bc1\u7b49\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Django\u5b89\u88c5\u4e0e\u9879\u76ee\u521b\u5efa<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5Django\u5e76\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install django<\/p>\n<p>django-admin startproject myproject<\/p>\n<p>cd myproject<\/p>\n<p>python manage.py startapp myapp<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728<code>settings.py<\/code>\u4e2d\u6ce8\u518c<code>myapp<\/code>\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">INSTALLED_APPS = [<\/p>\n<p>    ...<\/p>\n<p>    &#39;myapp&#39;,<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u89c6\u56fe\u4e0e\u6a21\u677f<\/strong><\/p>\n<\/p>\n<p><p>\u5728<code>myapp\/views.py<\/code>\u4e2d\u521b\u5efa\u4e00\u4e2a\u89c6\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from django.shortcuts import render<\/p>\n<p>def home(request):<\/p>\n<p>    return render(request, &#39;home.html&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728<code>urls.py<\/code>\u4e2d\u914d\u7f6e\u8def\u7531\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from django.contrib import admin<\/p>\n<p>from django.urls import path<\/p>\n<p>from myapp import views<\/p>\n<p>urlpatterns = [<\/p>\n<p>    path(&#39;admin\/&#39;, admin.site.urls),<\/p>\n<p>    path(&#39;&#39;, views.home, name=&#39;home&#39;),<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u521b\u5efa<code>home.html<\/code>\u6a21\u677f\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;Django App&lt;\/title&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;h1&gt;Welcome to My Django App&lt;\/h1&gt;<\/p>\n<p>    &lt;p&gt;This is a simple Django application.&lt;\/p&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884cDjango\u670d\u52a1\u5668\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python manage.py runserver<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8bbf\u95ee<code>http:\/\/127.0.0.1:8000\/<\/code>\uff0c\u5373\u53ef\u67e5\u770b\u9875\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u4f7f\u7528CGI\u5b9e\u73b0HTML\u4e0ePython\u7684\u7ed3\u5408<\/p>\n<\/p>\n<p><p>\u867d\u7136CGI\u4e0d\u662f\u73b0\u4ee3Web\u5f00\u53d1\u7684\u4e3b\u6d41\u9009\u62e9\uff0c\u4f46\u5b83\u662f\u7406\u89e3Web\u670d\u52a1\u5668\u4e0e\u5e94\u7528\u7a0b\u5e8f\u4ea4\u4e92\u7684\u57fa\u7840\u65b9\u6cd5\u4e4b\u4e00\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>CGI\u811a\u672c\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<p><p>\u786e\u4fddWeb\u670d\u52a1\u5668\uff08\u5982Apache\uff09\u652f\u6301CGI\u3002\u901a\u5e38\u9700\u8981\u5728\u670d\u52a1\u5668\u914d\u7f6e\u4e2d\u542f\u7528CGI\u652f\u6301\uff0c\u5e76\u6307\u5b9aCGI\u811a\u672c\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199CGI\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684CGI\u811a\u672c\uff0c\u4f8b\u5982<code>hello.py<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">#!\/usr\/bin\/env python3<\/p>\n<p>print(&quot;Content-Type: text\/html&quot;)<\/p>\n<p>print()<\/p>\n<p>print(&quot;&lt;html&gt;&lt;head&gt;&quot;)<\/p>\n<p>print(&quot;&lt;title&gt;CGI Script&lt;\/title&gt;&quot;)<\/p>\n<p>print(&quot;&lt;\/head&gt;&lt;body&gt;&quot;)<\/p>\n<p>print(&quot;&lt;h1&gt;Hello from Python CGI&lt;\/h1&gt;&quot;)<\/p>\n<p>print(&quot;&lt;\/body&gt;&lt;\/html&gt;&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fdd\u811a\u672c\u6709\u6267\u884c\u6743\u9650\uff0c\u5e76\u5c06\u5176\u653e\u7f6e\u5728CGI\u76ee\u5f55\u4e2d\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbf\u95eeCGI\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eeCGI\u811a\u672c\u7684URL\uff08\u5982<code>http:\/\/yourserver.com\/cgi-bin\/hello.py<\/code>\uff09\uff0c\u67e5\u770b\u8f93\u51fa\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u901a\u8fc7API\u5b9e\u73b0HTML\u4e0ePython\u7684\u7ed3\u5408<\/p>\n<\/p>\n<p><p>API\u662f\u73b0\u4ee3Web\u5e94\u7528\u4e2d\u5e38\u7528\u7684\u65b9\u5f0f\uff0c\u5b83\u5141\u8bb8\u524d\u540e\u7aef\u5206\u79bb\uff0c\u524d\u7aef\u901a\u8fc7HTTP\u8bf7\u6c42\u4e0e\u540e\u7aef\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaAPI\u7aef\u70b9<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528Flask\u6216Django REST Framework\u521b\u5efaAPI\u3002\u4ee5Flask\u4e3a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask, jsonify<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/api\/data&#39;)<\/p>\n<p>def get_data():<\/p>\n<p>    return jsonify({&#39;key&#39;: &#39;value&#39;})<\/p>\n<p>if __name__ == &#39;__main__&#39;:<\/p>\n<p>    app.run(debug=True)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u524d\u7aef\u901a\u8fc7AJAX\u8bf7\u6c42API<\/strong><\/p>\n<\/p>\n<p><p>\u5728HTML\u4e2d\uff0c\u901a\u8fc7JavaScript\u7684AJAX\u8bf7\u6c42API\u5e76\u5904\u7406\u54cd\u5e94\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html lang=&quot;en&quot;&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>    &lt;meta charset=&quot;UTF-8&quot;&gt;<\/p>\n<p>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<\/p>\n<p>    &lt;title&gt;API Example&lt;\/title&gt;<\/p>\n<p>    &lt;script&gt;<\/p>\n<p>        async function fetchData() {<\/p>\n<p>            const response = await fetch(&#39;\/api\/data&#39;);<\/p>\n<p>            const data = await response.json();<\/p>\n<p>            document.getElementById(&#39;output&#39;).textContent = JSON.stringify(data);<\/p>\n<p>        }<\/p>\n<p>    &lt;\/script&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body onload=&quot;fetchData()&quot;&gt;<\/p>\n<p>    &lt;h1&gt;API Data&lt;\/h1&gt;<\/p>\n<p>    &lt;pre id=&quot;output&quot;&gt;&lt;\/pre&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u4ecb\u7ecd\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230HTML\u4e0ePython\u7ed3\u5408\u7684\u591a\u79cd\u5b9e\u73b0\u65b9\u5f0f\u3002\u9009\u62e9\u54ea\u79cd\u65b9\u5f0f\u53d6\u51b3\u4e8e\u9879\u76ee\u7684\u89c4\u6a21\u3001\u590d\u6742\u6027\u3001\u4ee5\u53ca\u5f00\u53d1\u56e2\u961f\u7684\u6280\u672f\u6808\u548c\u9700\u6c42\u3002\u65e0\u8bba\u662f\u4f7f\u7528Web\u6846\u67b6\u3001CGI\uff0c\u8fd8\u662f\u901a\u8fc7API\uff0cPython\u90fd\u80fd\u4e3aWeb\u5f00\u53d1\u63d0\u4f9b\u5f3a\u5927\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5c06Python\u4e0eHTML\u7ed3\u5408\u4f7f\u7528\u8fdb\u884c\u52a8\u6001\u7f51\u9875\u5f00\u53d1\uff1f<\/strong><br \/>Python\u53ef\u4ee5\u901a\u8fc7\u5404\u79cd\u6846\u67b6\uff08\u5982Flask\u3001Django\u7b49\uff09\u4e0eHTML\u7ed3\u5408\uff0c\u521b\u5efa\u52a8\u6001\u7f51\u9875\u5e94\u7528\u3002\u4f7f\u7528\u8fd9\u4e9b\u6846\u67b6\uff0c\u60a8\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u7aef\u7f16\u5199Python\u4ee3\u7801\uff0c\u751f\u6210HTML\u9875\u9762\uff0c\u5e76\u6839\u636e\u7528\u6237\u8bf7\u6c42\u52a8\u6001\u5c55\u793a\u5185\u5bb9\u3002\u4f8b\u5982\uff0cFlask\u5141\u8bb8\u60a8\u4f7f\u7528\u6a21\u677f\u5f15\u64ce\u6765\u6e32\u67d3HTML\u6587\u4ef6\u5e76\u4f20\u9012\u6570\u636e\u3002<\/p>\n<p><strong>\u4f7f\u7528Python\u5904\u7406HTML\u8868\u5355\u6570\u636e\u7684\u6b65\u9aa4\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5f53\u7528\u6237\u901a\u8fc7HTML\u8868\u5355\u63d0\u4ea4\u6570\u636e\u65f6\uff0cPython\u53ef\u4ee5\u63a5\u6536\u5e76\u5904\u7406\u8fd9\u4e9b\u6570\u636e\u3002\u60a8\u9700\u8981\u5728HTML\u4e2d\u8bbe\u7f6e\u8868\u5355\u7684<code>action<\/code>\u5c5e\u6027\uff0c\u6307\u5411\u5904\u7406\u8bf7\u6c42\u7684Python\u8def\u7531\u3002\u63a5\u7740\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>request<\/code>\u5bf9\u8c61\u6765\u83b7\u53d6\u8868\u5355\u6570\u636e\uff0c\u5e76\u6839\u636e\u9700\u8981\u8fdb\u884c\u5904\u7406\u6216\u5b58\u50a8\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u4f7f\u7528Python\u751f\u6210\u9759\u6001HTML\u6587\u4ef6\uff1f<\/strong><br \/>\u662f\u7684\uff0cPython\u53ef\u4ee5\u751f\u6210\u9759\u6001HTML\u6587\u4ef6\u3002\u60a8\u53ef\u4ee5\u7f16\u5199Python\u811a\u672c\uff0c\u4f7f\u7528\u6587\u4ef6\u64cd\u4f5c\u529f\u80fd\u521b\u5efaHTML\u6587\u4ef6\uff0c\u5e76\u5c06\u5185\u5bb9\u5199\u5165\u5176\u4e2d\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u751f\u6210\u62a5\u544a\u3001\u7f51\u9875\u5feb\u7167\u7b49\u9759\u6001\u5185\u5bb9\uff0c\u65b9\u4fbf\u7528\u6237\u76f4\u63a5\u8bbf\u95ee\u800c\u65e0\u9700\u8fd0\u884c\u670d\u52a1\u5668\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"HTML\u4e0ePython\u7684\u7ed3\u5408\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528Web\u6846\u67b6\uff08\u5982Flask\u548cDjango\uff09\u3001\u901a\u8fc7CGI [&hellip;]","protected":false},"author":3,"featured_media":1013812,"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\/1013806"}],"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=1013806"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1013806\/revisions"}],"predecessor-version":[{"id":1013814,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1013806\/revisions\/1013814"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1013812"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1013806"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1013806"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1013806"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}