{"id":980103,"date":"2024-12-27T06:51:49","date_gmt":"2024-12-26T22:51:49","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/980103.html"},"modified":"2024-12-27T06:51:51","modified_gmt":"2024-12-26T22:51:51","slug":"python%e5%a6%82%e4%bd%95%e5%bb%ba%e7%ab%8b%e5%89%8d%e7%ab%af%e9%a1%b5%e9%9d%a2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/980103.html","title":{"rendered":"python\u5982\u4f55\u5efa\u7acb\u524d\u7aef\u9875\u9762"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24205626\/5c8c0cb2-4a5e-4bb8-8da1-5f153aecbb2c.webp\" alt=\"python\u5982\u4f55\u5efa\u7acb\u524d\u7aef\u9875\u9762\" \/><\/p>\n<p><p> <strong>Python\u53ef\u4ee5\u901a\u8fc7Flask\u3001Django\u3001Streamlit\u7b49\u6846\u67b6\u6765\u5efa\u7acb\u524d\u7aef\u9875\u9762\u3001\u7ed3\u5408HTML\/CSS\/JavaScript\u8fdb\u884c\u524d\u7aef\u5f00\u53d1\u3001\u4f7f\u7528\u6a21\u677f\u5f15\u64ce\u5982Jinja2\u6765\u52a8\u6001\u6e32\u67d3\u9875\u9762\u3002<\/strong> Flask\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Web\u6846\u67b6\uff0c\u9002\u5408\u6784\u5efa\u7b80\u5355\u7684\u5e94\u7528\uff1bDjango\u5219\u662f\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u6846\u67b6\uff0c\u9002\u5408\u590d\u6742\u7684\u9879\u76ee\u5f00\u53d1\u3002Streamlit\u662f\u4e00\u4e2a\u4e13\u6ce8\u4e8e\u6570\u636e\u5e94\u7528\u7684\u6846\u67b6\uff0c\u5feb\u901f\u521b\u5efa\u4ea4\u4e92\u5f0f\u6570\u636e\u5e94\u7528\u662f\u5176\u5f3a\u9879\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u6846\u67b6\u6784\u5efa\u524d\u7aef\u9875\u9762\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001FLASK\u6846\u67b6<\/h3>\n<\/p>\n<p><p>Flask\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684Python Web\u6846\u67b6\uff0c\u5177\u6709\u8f7b\u91cf\u3001\u7075\u6d3b\u7684\u7279\u70b9\uff0c\u9002\u5408\u5feb\u901f\u5f00\u53d1\u548c\u539f\u578b\u8bbe\u8ba1\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u4e0e\u57fa\u672c\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u7684\u73af\u5883\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86Flask\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u547d\u4ee4\u6765\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\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Flask\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import Flask<\/p>\n<p>app = Flask(__name__)<\/p>\n<p>@app.route(&#39;\/&#39;)<\/p>\n<p>def home():<\/p>\n<p>    return &quot;Hello, World!&quot;<\/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>\u8fd0\u884c\u4e0a\u8ff0\u4ee3\u7801\u540e\uff0c\u4f60\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee<code>http:\/\/127.0.0.1:5000\/<\/code>\uff0c\u770b\u5230\u201cHello, World!\u201d\u7684\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><h4>2\u3001\u6a21\u677f\u6e32\u67d3<\/h4>\n<\/p>\n<p><p>Flask\u4f7f\u7528Jinja2\u4f5c\u4e3a\u6a21\u677f\u5f15\u64ce\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5c06Python\u53d8\u91cf\u4f20\u9012\u5230HTML\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from flask import render_template<\/p>\n<p>@app.route(&#39;\/hello\/&lt;name&gt;&#39;)<\/p>\n<p>def hello(name):<\/p>\n<p>    return render_template(&#39;hello.html&#39;, name=name)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>hello.html<\/code>\u6a21\u677f\u6587\u4ef6\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!doctype html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;Hello&lt;\/title&gt;&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>\u8fd9\u6837\uff0c\u5f53\u4f60\u8bbf\u95ee<code>\/hello\/YourName<\/code>\u65f6\uff0c\u9875\u9762\u5c06\u4f1a\u663e\u793a\u201cHello, YourName!\u201d\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001DJANGO\u6846\u67b6<\/h3>\n<\/p>\n<p><p>Django\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684Web\u6846\u67b6\uff0c\u9002\u5408\u5927\u578b\u9879\u76ee\u5f00\u53d1\u3002\u5b83\u63d0\u4f9b\u4e86\u5168\u9762\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u5305\u62ecORM\u3001\u6a21\u677f\u7cfb\u7edf\u3001\u8ba4\u8bc1\u7cfb\u7edf\u7b49\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u4e0e\u521b\u5efa\u9879\u76ee<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u5b89\u88c5Django\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install Django<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Django\u9879\u76ee\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">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><h4>2\u3001\u89c6\u56fe\u4e0e\u6a21\u677f<\/h4>\n<\/p>\n<p><p>\u5728Django\u4e2d\uff0c\u89c6\u56fe\u8d1f\u8d23\u5904\u7406\u8bf7\u6c42\u5e76\u8fd4\u56de\u54cd\u5e94\u3002\u53ef\u4ee5\u5728<code>views.py<\/code>\u4e2d\u5b9a\u4e49\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;, {&#39;name&#39;: &#39;World&#39;})<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728<code>home.html<\/code>\u6a21\u677f\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u50cfFlask\u4e00\u6837\u4f7f\u7528\u6a21\u677f\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!doctype html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;Home&lt;\/title&gt;&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>\u914d\u7f6eURL\u6620\u5c04\uff0c\u4f7f\u5176\u6307\u5411\u89c6\u56fe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from django.urls import path<\/p>\n<p>from . import views<\/p>\n<p>urlpatterns = [<\/p>\n<p>    path(&#39;&#39;, views.home, name=&#39;home&#39;),<\/p>\n<p>]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3\u3001\u8fd0\u884cDjango\u9879\u76ee<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884cDjango\u5f00\u53d1\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\u770b\u5230\u9875\u9762\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001STREAMLIT\u6846\u67b6<\/h3>\n<\/p>\n<p><p>Streamlit\u662f\u4e00\u4e2a\u4e13\u6ce8\u4e8e\u5feb\u901f\u5f00\u53d1\u6570\u636e\u5e94\u7528\u7684\u6846\u67b6\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u5206\u6790\u5e08\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5b89\u88c5\u4e0e\u57fa\u672c\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>\u5b89\u88c5Streamlit\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install streamlit<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2aStreamlit\u5e94\u7528\uff0c\u4f8b\u5982<code>app.py<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import streamlit as st<\/p>\n<p>st.title(&quot;Hello World App&quot;)<\/p>\n<p>st.write(&quot;Welcome to the Streamlit app!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">streamlit run app.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u521b\u5efa\u4ea4\u4e92\u5f0f\u7ec4\u4ef6<\/h4>\n<\/p>\n<p><p>Streamlit\u63d0\u4f9b\u4e86\u591a\u79cd\u4ea4\u4e92\u7ec4\u4ef6\uff0c\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u6dfb\u52a0\u5230\u9875\u9762\u4e2d\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import streamlit as st<\/p>\n<p>st.title(&quot;Interactive Widgets&quot;)<\/p>\n<p>name = st.text_input(&quot;Enter your name:&quot;)<\/p>\n<p>st.write(f&quot;Hello, {name}!&quot;)<\/p>\n<p>if st.button(&quot;Say Hello&quot;):<\/p>\n<p>    st.write(f&quot;Hello, {name}!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5feb\u901f\u521b\u5efa\u7b80\u5355\u7684\u524d\u7aef\u9875\u9762\uff0c\u5c24\u5176\u9002\u5408\u6570\u636e\u5c55\u793a\u548c\u4ea4\u4e92\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u7ed3\u5408HTML\/CSS\/JavaScript<\/h3>\n<\/p>\n<p><p>\u65e0\u8bba\u662fFlask\u3001Django\u8fd8\u662fStreamlit\uff0c\u6700\u7ec8\u751f\u6210\u7684\u90fd\u662fHTML\u9875\u9762\u3002\u53ef\u4ee5\u901a\u8fc7\u5d4c\u5165CSS\u548cJavaScript\u6765\u589e\u5f3a\u9875\u9762\u7684\u6837\u5f0f\u548c\u4ea4\u4e92\u6027\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u5f15\u5165CSS\u6837\u5f0f<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u5728\u6a21\u677f\u6587\u4ef6\u4e2d\u5f15\u5165CSS\u6837\u5f0f\uff0c\u63d0\u5347\u9875\u9762\u7f8e\u89c2\u5ea6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;head&gt;<\/p>\n<p>    &lt;link rel=&quot;stylesheet&quot; href=&quot;{{ url_for(&#39;static&#39;, filename=&#39;style.css&#39;) }}&quot;&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728<code>style.css<\/code>\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u6dfb\u52a0\u81ea\u5b9a\u4e49\u6837\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-css\">body {<\/p>\n<p>    background-color: #f0f0f0;<\/p>\n<p>    font-family: Arial, sans-serif;<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u6dfb\u52a0JavaScript\u529f\u80fd<\/h4>\n<\/p>\n<p><p>\u901a\u8fc7JavaScript\u53ef\u4ee5\u4e3a\u9875\u9762\u6dfb\u52a0\u66f4\u591a\u7684\u52a8\u6001\u6548\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;script&gt;<\/p>\n<p>    function showAlert() {<\/p>\n<p>        alert(&#39;Hello, JavaScript!&#39;);<\/p>\n<p>    }<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u9875\u9762\u4e2d\u8c03\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;button onclick=&quot;showAlert()&quot;&gt;Click Me&lt;\/button&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u6a21\u677f\u5f15\u64ceJinja2<\/h3>\n<\/p>\n<p><p>Jinja2\u662f\u4e00\u4e2a\u73b0\u4ee3\u7684\u3001\u8bbe\u8ba1\u4f18\u96c5\u7684Python\u6a21\u677f\u5f15\u64ce\uff0c\u53ef\u4ee5\u5728Flask\u548cDjango\u4e2d\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h4>1\u3001\u6a21\u677f\u8bed\u6cd5<\/h4>\n<\/p>\n<p><p>Jinja2\u7684\u6a21\u677f\u8bed\u6cd5\u7b80\u5355\u76f4\u89c2\uff0c\u652f\u6301\u53d8\u91cf\u66ff\u6362\u3001\u63a7\u5236\u7ed3\u6784\u7b49\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;ul&gt;<\/p>\n<p>{% for item in items %}<\/p>\n<p>    &lt;li&gt;{{ item }}&lt;\/li&gt;<\/p>\n<p>{% endfor %}<\/p>\n<p>&lt;\/ul&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u7ee7\u627f\u4e0e\u6269\u5c55<\/h4>\n<\/p>\n<p><p>Jinja2\u652f\u6301\u6a21\u677f\u7ee7\u627f\uff0c\u53ef\u4ee5\u901a\u8fc7\u57fa\u7840\u6a21\u677f\u6765\u7edf\u4e00\u7ba1\u7406\u9875\u9762\u7ed3\u6784\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">&lt;!-- base.html --&gt;<\/p>\n<p>&lt;!doctype html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;&lt;title&gt;{% block title %}My Site{% endblock %}&lt;\/title&gt;&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>    &lt;header&gt;{% block header %}{% endblock %}&lt;\/header&gt;<\/p>\n<p>    &lt;main&gt;{% block content %}{% endblock %}&lt;\/main&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u5176\u4ed6\u6a21\u677f\u4e2d\u7ee7\u627f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-html\">{% extends &quot;base.html&quot; %}<\/p>\n<p>{% block title %}Home{% endblock %}<\/p>\n<p>{% block content %}<\/p>\n<p>    &lt;h1&gt;Welcome to the Home Page&lt;\/h1&gt;<\/p>\n<p>{% endblock %}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u51cf\u5c11\u4ee3\u7801\u91cd\u590d\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u901a\u8fc7Flask\u3001Django\u548cStreamlit\u7b49\u6846\u67b6\u53ef\u4ee5\u5feb\u901f\u6784\u5efa\u524d\u7aef\u9875\u9762\u3002<strong>Flask\u9002\u5408\u5feb\u901f\u5f00\u53d1\u548c\u539f\u578b\u8bbe\u8ba1\uff0cDjango\u5219\u662f\u5168\u80fd\u7684Web\u6846\u67b6\uff0c\u9002\u5408\u590d\u6742\u9879\u76ee\uff0cStreamlit\u5219\u4e13\u6ce8\u4e8e\u6570\u636e\u5e94\u7528\u7684\u5feb\u901f\u5f00\u53d1<\/strong>\u3002\u7ed3\u5408HTML\/CSS\/JavaScript\uff0c\u53ef\u4ee5\u521b\u5efa\u529f\u80fd\u4e30\u5bcc\u4e14\u7f8e\u89c2\u7684Web\u5e94\u7528\u3002Jinja2\u6a21\u677f\u5f15\u64ce\u5728\u52a8\u6001\u6e32\u67d3\u9875\u9762\u4e2d\u626e\u6f14\u7740\u91cd\u8981\u89d2\u8272\uff0c\u652f\u6301\u53d8\u91cf\u66ff\u6362\u3001\u63a7\u5236\u7ed3\u6784\u3001\u6a21\u677f\u7ee7\u627f\u7b49\u529f\u80fd\u3002\u638c\u63e1\u8fd9\u4e9b\u6280\u80fd\uff0c\u80fd\u591f\u5927\u5927\u63d0\u5347Web\u5f00\u53d1\u6548\u7387\u548c\u9875\u9762\u8d28\u91cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u7528Python\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u524d\u7aef\u9875\u9762\uff1f<\/strong><br \/>\u4f7f\u7528Python\u521b\u5efa\u524d\u7aef\u9875\u9762\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7Flask\u6216Django\u7b49\u6846\u67b6\u6765\u5b9e\u73b0\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Flask\u6784\u5efa\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684web\u5e94\u7528\uff0c\u5229\u7528HTML\u3001CSS\u548cJavaScript\u6765\u8bbe\u8ba1\u524d\u7aef\u9875\u9762\u3002\u901a\u8fc7Flask\u7684\u8def\u7531\u529f\u80fd\uff0c\u4f60\u53ef\u4ee5\u5c06\u7528\u6237\u8bf7\u6c42\u4e0e\u76f8\u5e94\u7684HTML\u6587\u4ef6\u8fde\u63a5\uff0c\u4ece\u800c\u521b\u5efa\u52a8\u6001\u5185\u5bb9\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406\u524d\u7aef\u4e0e\u540e\u7aef\u7684\u4ea4\u4e92\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7AJAX\u6280\u672f\u5b9e\u73b0\u524d\u7aef\u4e0e\u540e\u7aef\u7684\u5f02\u6b65\u4ea4\u4e92\u3002\u5728Python\u7684Flask\u6216Django\u4e2d\uff0c\u4f60\u53ef\u4ee5\u8bbe\u7f6eAPI\u7aef\u70b9\uff0c\u5f53\u7528\u6237\u5728\u524d\u7aef\u53d1\u8d77\u8bf7\u6c42\u65f6\uff0c\u540e\u7aef\u4f1a\u5904\u7406\u8fd9\u4e9b\u8bf7\u6c42\u5e76\u8fd4\u56de\u6570\u636e\u3002\u901a\u8fc7JavaScript\u7684fetch API\u6216jQuery\u7684ajax\u65b9\u6cd5\uff0c\u524d\u7aef\u53ef\u4ee5\u53d1\u9001\u8bf7\u6c42\u5e76\u5904\u7406\u54cd\u5e94\u6570\u636e\uff0c\u4ece\u800c\u5b9e\u73b0\u65e0\u5237\u65b0\u66f4\u65b0\u9875\u9762\u5185\u5bb9\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u4f7f\u7528Python\u7684GUI\u5e93\u521b\u5efa\u684c\u9762\u5e94\u7528\u7684\u524d\u7aef\uff1f<\/strong><br \/>\u662f\u7684\uff0cPython\u6709\u591a\u79cdGUI\u5e93\u53ef\u4f9b\u9009\u62e9\uff0c\u6bd4\u5982Tkinter\u3001PyQt\u548cKivy\u3002\u8fd9\u4e9b\u5e93\u5141\u8bb8\u4f60\u521b\u5efa\u684c\u9762\u5e94\u7528\u7684\u7528\u6237\u754c\u9762\u3002\u4f7f\u7528\u8fd9\u4e9b\u5e93\u65f6\uff0c\u4f60\u53ef\u4ee5\u8bbe\u8ba1\u7a97\u53e3\u3001\u6309\u94ae\u3001\u6587\u672c\u6846\u7b49\u7ec4\u4ef6\uff0c\u6784\u5efa\u51fa\u7528\u6237\u53cb\u597d\u7684\u524d\u7aef\u4f53\u9a8c\u3002\u6bcf\u4e2a\u5e93\u90fd\u6709\u5176\u72ec\u7279\u7684\u7279\u70b9\u548c\u9002\u7528\u573a\u666f\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5e93\u8fdb\u884c\u5f00\u53d1\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u53ef\u4ee5\u901a\u8fc7Flask\u3001Django\u3001Streamlit\u7b49\u6846\u67b6\u6765\u5efa\u7acb\u524d\u7aef\u9875\u9762\u3001\u7ed3\u5408HTML\/CSS\/J [&hellip;]","protected":false},"author":3,"featured_media":980109,"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\/980103"}],"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=980103"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/980103\/revisions"}],"predecessor-version":[{"id":980112,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/980103\/revisions\/980112"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/980109"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=980103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=980103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=980103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}