{"id":1181898,"date":"2025-01-15T18:57:04","date_gmt":"2025-01-15T10:57:04","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1181898.html"},"modified":"2025-01-15T18:57:07","modified_gmt":"2025-01-15T10:57:07","slug":"python%e5%a6%82%e4%bd%95%e5%81%9a%e6%94%b6%e9%93%b6%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1181898.html","title":{"rendered":"python\u5982\u4f55\u505a\u6536\u94f6\u7cfb\u7edf"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25130056\/449339c7-92f2-4d49-801e-91f04c1ece97.webp\" alt=\"python\u5982\u4f55\u505a\u6536\u94f6\u7cfb\u7edf\" \/><\/p>\n<p><p> <strong>Python\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u56fe\u5f62\u7528\u6237\u754c\u9762\uff08GUI\uff09\u5e93\u3001\u6570\u636e\u5e93\u4ee5\u53caPython\u81ea\u8eab\u7684\u529f\u80fd\u6765\u6784\u5efa\u4e00\u4e2a\u6536\u94f6\u7cfb\u7edf\u3001\u5176\u4e2d\u5305\u62ec\u4ea7\u54c1\u4fe1\u606f\u7ba1\u7406\u3001\u9500\u552e\u8bb0\u5f55\u3001\u6536\u636e\u6253\u5370\u4ee5\u53ca\u5e93\u5b58\u7ba1\u7406\u7b49\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u6b65\u9aa4\u548c\u4ee3\u7801\u793a\u4f8b\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u9009\u62e9\u5408\u9002\u7684Python\u5e93\u548c\u6846\u67b6<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u6784\u5efa\u6536\u94f6\u7cfb\u7edf\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u9009\u62e9\u5408\u9002\u7684Python\u5e93\u548c\u6846\u67b6\u3002\u5e38\u7528\u7684\u5e93\u548c\u6846\u67b6\u6709\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>Tkinter<\/strong>\uff1aPython\u6807\u51c6\u5e93\u4e2d\u7684GUI\u5de5\u5177\u5305\uff0c\u975e\u5e38\u9002\u5408\u6784\u5efa\u7b80\u5355\u7684\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li><strong>SQLite<\/strong>\uff1aPython\u6807\u51c6\u5e93\u4e2d\u7684\u8f7b\u91cf\u7ea7\u6570\u636e\u5e93\uff0c\u9002\u7528\u4e8e\u5b58\u50a8\u5c0f\u578b\u5e94\u7528\u7684\u6570\u636e\u3002<\/li>\n<li><strong>Pandas<\/strong>\uff1a\u6570\u636e\u5206\u6790\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u5904\u7406\u548c\u5206\u6790\u6570\u636e\u3002<\/li>\n<li><strong>ReportLab<\/strong>\uff1a\u7528\u4e8e\u751f\u6210PDF\u6587\u6863\u7684\u5e93\uff0c\u53ef\u4ee5\u7528\u4e8e\u751f\u6210\u6536\u636e\u3002<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u521b\u5efa\u57fa\u672c\u7684GUI\u754c\u9762<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Tkinter\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684GUI\u754c\u9762\uff0c\u5305\u62ec\u4ea7\u54c1\u5217\u8868\u3001\u6570\u91cf\u8f93\u5165\u3001\u4ef7\u683c\u663e\u793a\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import tkinter as tk<\/p>\n<p>from tkinter import messagebox<\/p>\n<p>import sqlite3<\/p>\n<h2><strong>\u521b\u5efa\u4e3b\u7a97\u53e3<\/strong><\/h2>\n<p>root = tk.Tk()<\/p>\n<p>root.title(&quot;\u6536\u94f6\u7cfb\u7edf&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/h2>\n<p>conn = sqlite3.connect(&#39;cashier.db&#39;)<\/p>\n<p>c = conn.cursor()<\/p>\n<h2><strong>\u521b\u5efa\u4ea7\u54c1\u8868<\/strong><\/h2>\n<p>c.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS products<\/p>\n<p>             (id INTEGER PRIMARY KEY, name TEXT, price REAL)&#39;&#39;&#39;)<\/p>\n<h2><strong>\u63d2\u5165\u793a\u4f8b\u6570\u636e<\/strong><\/h2>\n<p>c.execute(&quot;INSERT INTO products (name, price) VALUES (&#39;\u82f9\u679c&#39;, 3.0)&quot;)<\/p>\n<p>c.execute(&quot;INSERT INTO products (name, price) VALUES (&#39;\u9999\u8549&#39;, 2.5)&quot;)<\/p>\n<p>conn.commit()<\/p>\n<h2><strong>\u521b\u5efa\u4ea7\u54c1\u5217\u8868\u6846<\/strong><\/h2>\n<p>product_listbox = tk.Listbox(root)<\/p>\n<p>product_listbox.pack()<\/p>\n<h2><strong>\u586b\u5145\u4ea7\u54c1\u5217\u8868\u6846<\/strong><\/h2>\n<p>c.execute(&quot;SELECT * FROM products&quot;)<\/p>\n<p>products = c.fetchall()<\/p>\n<p>for product in products:<\/p>\n<p>    product_listbox.insert(tk.END, f&quot;{product[1]} - ${product[2]:.2f}&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u6570\u91cf\u8f93\u5165\u6846<\/strong><\/h2>\n<p>quantity_label = tk.Label(root, text=&quot;\u6570\u91cf:&quot;)<\/p>\n<p>quantity_label.pack()<\/p>\n<p>quantity_entry = tk.Entry(root)<\/p>\n<p>quantity_entry.pack()<\/p>\n<h2><strong>\u521b\u5efa\u603b\u4ef7\u6807\u7b7e<\/strong><\/h2>\n<p>total_label = tk.Label(root, text=&quot;\u603b\u4ef7: $0.00&quot;)<\/p>\n<p>total_label.pack()<\/p>\n<h2><strong>\u8ba1\u7b97\u603b\u4ef7\u7684\u51fd\u6570<\/strong><\/h2>\n<p>def calculate_total():<\/p>\n<p>    try:<\/p>\n<p>        selected_product = product_listbox.get(product_listbox.curselection())<\/p>\n<p>        price = float(selected_product.split(&#39;- $&#39;)[1])<\/p>\n<p>        quantity = int(quantity_entry.get())<\/p>\n<p>        total = price * quantity<\/p>\n<p>        total_label.config(text=f&quot;\u603b\u4ef7: ${total:.2f}&quot;)<\/p>\n<p>    except Exception as e:<\/p>\n<p>        messagebox.showerror(&quot;\u9519\u8bef&quot;, &quot;\u8bf7\u9009\u62e9\u4e00\u4e2a\u4ea7\u54c1\u5e76\u8f93\u5165\u6709\u6548\u7684\u6570\u91cf&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u8ba1\u7b97\u6309\u94ae<\/strong><\/h2>\n<p>calculate_button = tk.Button(root, text=&quot;\u8ba1\u7b97&quot;, command=calculate_total)<\/p>\n<p>calculate_button.pack()<\/p>\n<h2><strong>\u8fd0\u884c\u4e3b\u5faa\u73af<\/strong><\/h2>\n<p>root.m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>nloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u7ba1\u7406\u4ea7\u54c1\u4fe1\u606f<\/h3>\n<\/p>\n<p><p>\u5728\u6536\u94f6\u7cfb\u7edf\u4e2d\uff0c\u7ba1\u7406\u4ea7\u54c1\u4fe1\u606f\u662f\u975e\u5e38\u91cd\u8981\u7684\u4e00\u90e8\u5206\u3002\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u4ea7\u54c1\u4fe1\u606f\u6765\u7ef4\u62a4\u4ea7\u54c1\u5217\u8868\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6dfb\u52a0\u4ea7\u54c1<\/p>\n<p>def add_product(name, price):<\/p>\n<p>    c.execute(&quot;INSERT INTO products (name, price) VALUES (?, ?)&quot;, (name, price))<\/p>\n<p>    conn.commit()<\/p>\n<p>    product_listbox.insert(tk.END, f&quot;{name} - ${price:.2f}&quot;)<\/p>\n<h2><strong>\u5220\u9664\u4ea7\u54c1<\/strong><\/h2>\n<p>def delete_product(product_id):<\/p>\n<p>    c.execute(&quot;DELETE FROM products WHERE id=?&quot;, (product_id,))<\/p>\n<p>    conn.commit()<\/p>\n<p>    product_listbox.delete(product_id)<\/p>\n<h2><strong>\u4fee\u6539\u4ea7\u54c1<\/strong><\/h2>\n<p>def update_product(product_id, name, price):<\/p>\n<p>    c.execute(&quot;UPDATE products SET name=?, price=? WHERE id=?&quot;, (name, price, product_id))<\/p>\n<p>    conn.commit()<\/p>\n<p>    product_listbox.delete(product_id)<\/p>\n<p>    product_listbox.insert(product_id, f&quot;{name} - ${price:.2f}&quot;)<\/p>\n<h2><strong>\u793a\u4f8b\u8c03\u7528<\/strong><\/h2>\n<p>add_product(&#39;\u6a59\u5b50&#39;, 4.0)<\/p>\n<p>delete_product(1)<\/p>\n<p>update_product(2, &#39;\u9999\u8549&#39;, 2.8)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u8bb0\u5f55\u9500\u552e\u548c\u751f\u6210\u6536\u636e<\/h3>\n<\/p>\n<p><p>\u6536\u94f6\u7cfb\u7edf\u9700\u8981\u8bb0\u5f55\u6bcf\u7b14\u9500\u552e\uff0c\u5e76\u751f\u6210\u6536\u636e\u4f9b\u987e\u5ba2\u67e5\u770b\u3002\u53ef\u4ee5\u4f7f\u7528SQLite\u5b58\u50a8\u9500\u552e\u8bb0\u5f55\uff0c\u5e76\u4f7f\u7528ReportLab\u751f\u6210\u6536\u636e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from reportlab.lib.pagesizes import letter<\/p>\n<p>from reportlab.pdfgen import canvas<\/p>\n<h2><strong>\u521b\u5efa\u9500\u552e\u8bb0\u5f55\u8868<\/strong><\/h2>\n<p>c.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS sales<\/p>\n<p>             (id INTEGER PRIMARY KEY, product_id INTEGER, quantity INTEGER, total REAL)&#39;&#39;&#39;)<\/p>\n<h2><strong>\u8bb0\u5f55\u9500\u552e<\/strong><\/h2>\n<p>def record_sale(product_id, quantity, total):<\/p>\n<p>    c.execute(&quot;INSERT INTO sales (product_id, quantity, total) VALUES (?, ?, ?)&quot;, (product_id, quantity, total))<\/p>\n<p>    conn.commit()<\/p>\n<h2><strong>\u751f\u6210\u6536\u636e<\/strong><\/h2>\n<p>def generate_receipt(product_name, quantity, total):<\/p>\n<p>    c = canvas.Canvas(&quot;receipt.pdf&quot;, pagesize=letter)<\/p>\n<p>    c.drawString(100, 750, f&quot;\u4ea7\u54c1: {product_name}&quot;)<\/p>\n<p>    c.drawString(100, 735, f&quot;\u6570\u91cf: {quantity}&quot;)<\/p>\n<p>    c.drawString(100, 720, f&quot;\u603b\u4ef7: ${total:.2f}&quot;)<\/p>\n<p>    c.save()<\/p>\n<h2><strong>\u793a\u4f8b\u8c03\u7528<\/strong><\/h2>\n<p>record_sale(2, 3, 7.5)<\/p>\n<p>generate_receipt(&#39;\u9999\u8549&#39;, 3, 7.5)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5e93\u5b58\u7ba1\u7406<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fdd\u4ea7\u54c1\u5e93\u5b58\u7684\u51c6\u786e\u6027\uff0c\u9700\u8981\u5728\u6bcf\u6b21\u9500\u552e\u4e4b\u540e\u66f4\u65b0\u5e93\u5b58\uff0c\u5e76\u5728\u5e93\u5b58\u4e0d\u8db3\u65f6\u63d0\u9192\u7528\u6237\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u5e93\u5b58\u8868<\/p>\n<p>c.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS stock<\/p>\n<p>             (product_id INTEGER PRIMARY KEY, quantity INTEGER)&#39;&#39;&#39;)<\/p>\n<h2><strong>\u66f4\u65b0\u5e93\u5b58<\/strong><\/h2>\n<p>def update_stock(product_id, quantity_sold):<\/p>\n<p>    c.execute(&quot;SELECT quantity FROM stock WHERE product_id=?&quot;, (product_id,))<\/p>\n<p>    current_quantity = c.fetchone()[0]<\/p>\n<p>    new_quantity = current_quantity - quantity_sold<\/p>\n<p>    if new_quantity &lt; 0:<\/p>\n<p>        messagebox.showerror(&quot;\u9519\u8bef&quot;, &quot;\u5e93\u5b58\u4e0d\u8db3&quot;)<\/p>\n<p>        return False<\/p>\n<p>    c.execute(&quot;UPDATE stock SET quantity=? WHERE product_id=?&quot;, (new_quantity, product_id))<\/p>\n<p>    conn.commit()<\/p>\n<p>    return True<\/p>\n<h2><strong>\u793a\u4f8b\u8c03\u7528<\/strong><\/h2>\n<p>if update_stock(2, 3):<\/p>\n<p>    record_sale(2, 3, 7.5)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u7528\u6237\u754c\u9762\u4f18\u5316<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u63d0\u5347\u7528\u6237\u4f53\u9a8c\uff0c\u53ef\u4ee5\u5bf9\u754c\u9762\u8fdb\u884c\u4f18\u5316\uff0c\u4f8b\u5982\u6dfb\u52a0\u83dc\u5355\u680f\u3001\u5de5\u5177\u680f\u3001\u72b6\u6001\u680f\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u521b\u5efa\u83dc\u5355\u680f<\/p>\n<p>menu_bar = tk.Menu(root)<\/p>\n<p>root.config(menu=menu_bar)<\/p>\n<h2><strong>\u521b\u5efa\u6587\u4ef6\u83dc\u5355<\/strong><\/h2>\n<p>file_menu = tk.Menu(menu_bar, tearoff=0)<\/p>\n<p>file_menu.add_command(label=&quot;\u9000\u51fa&quot;, command=root.quit)<\/p>\n<p>menu_bar.add_cascade(label=&quot;\u6587\u4ef6&quot;, menu=file_menu)<\/p>\n<h2><strong>\u521b\u5efa\u5e2e\u52a9\u83dc\u5355<\/strong><\/h2>\n<p>help_menu = tk.Menu(menu_bar, tearoff=0)<\/p>\n<p>help_menu.add_command(label=&quot;\u5173\u4e8e&quot;, command=lambda: messagebox.showinfo(&quot;\u5173\u4e8e&quot;, &quot;\u6536\u94f6\u7cfb\u7edf v1.0&quot;))<\/p>\n<p>menu_bar.add_cascade(label=&quot;\u5e2e\u52a9&quot;, menu=help_menu)<\/p>\n<h2><strong>\u521b\u5efa\u5de5\u5177\u680f<\/strong><\/h2>\n<p>toolbar = tk.Frame(root, bd=1, relief=tk.RAISED)<\/p>\n<p>add_button = tk.Button(toolbar, text=&quot;\u6dfb\u52a0\u4ea7\u54c1&quot;, command=lambda: add_product(&#39;\u68a8\u5b50&#39;, 5.0))<\/p>\n<p>add_button.pack(side=tk.LEFT, padx=2, pady=2)<\/p>\n<p>toolbar.pack(side=tk.TOP, fill=tk.X)<\/p>\n<h2><strong>\u521b\u5efa\u72b6\u6001\u680f<\/strong><\/h2>\n<p>status_bar = tk.Label(root, text=&quot;\u6b22\u8fce\u4f7f\u7528\u6536\u94f6\u7cfb\u7edf&quot;, bd=1, relief=tk.SUNKEN, anchor=tk.W)<\/p>\n<p>status_bar.pack(side=tk.BOTTOM, fill=tk.X)<\/p>\n<h2><strong>\u8fd0\u884c\u4e3b\u5faa\u73af<\/strong><\/h2>\n<p>root.mainloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e03\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u6784\u5efa\u4e00\u4e2a\u529f\u80fd\u5b8c\u5584\u7684\u6536\u94f6\u7cfb\u7edf\u3002\u8be5\u7cfb\u7edf\u5305\u62ec\u4ea7\u54c1\u4fe1\u606f\u7ba1\u7406\u3001\u9500\u552e\u8bb0\u5f55\u3001\u6536\u636e\u751f\u6210\u548c\u5e93\u5b58\u7ba1\u7406\u7b49\u529f\u80fd\u3002\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u5bf9\u7cfb\u7edf\u8fdb\u884c\u6269\u5c55\u548c\u4f18\u5316\uff0c\u4f8b\u5982\u6dfb\u52a0\u7528\u6237\u7ba1\u7406\u3001\u62a5\u8868\u751f\u6210\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<p><p><strong>\u6ce8\u610f\uff1a<\/strong> \u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u5e94\u6ce8\u610f\u6570\u636e\u5e93\u7684\u5b89\u5168\u6027\u548c\u6570\u636e\u7684\u5907\u4efd\uff0c\u786e\u4fdd\u7cfb\u7edf\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\u3002\u540c\u65f6\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u66f4\u4e13\u4e1a\u7684\u5e93\u548c\u6846\u67b6\uff0c\u5982Django\u6216Flask\uff0c\u6765\u6784\u5efa\u66f4\u590d\u6742\u548c\u5f3a\u5927\u7684\u6536\u94f6\u7cfb\u7edf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5f00\u59cb\u4f7f\u7528Python\u5f00\u53d1\u4e00\u4e2a\u6536\u94f6\u7cfb\u7edf\uff1f<\/strong><br \/>\u5f00\u53d1\u6536\u94f6\u7cfb\u7edf\u7684\u7b2c\u4e00\u6b65\u662f\u660e\u786e\u7cfb\u7edf\u7684\u9700\u6c42\uff0c\u5305\u62ec\u7528\u6237\u754c\u9762\u8bbe\u8ba1\u3001\u5546\u54c1\u7ba1\u7406\u3001\u9500\u552e\u8bb0\u5f55\u548c\u62a5\u8868\u751f\u6210\u7b49\u529f\u80fd\u3002\u9009\u62e9\u5408\u9002\u7684\u5f00\u53d1\u6846\u67b6\uff0c\u5982Flask\u6216Django\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5feb\u901f\u6784\u5efa\u5e94\u7528\u3002\u63a5\u4e0b\u6765\uff0c\u8003\u8651\u4f7f\u7528SQLite\u6216MySQL\u7b49\u6570\u636e\u5e93\u6765\u5b58\u50a8\u5546\u54c1\u4fe1\u606f\u548c\u4ea4\u6613\u8bb0\u5f55\u3002\u901a\u8fc7\u7f16\u5199Python\u4ee3\u7801\u5b9e\u73b0\u524d\u540e\u7aef\u4ea4\u4e92\uff0c\u5b8c\u6210\u521d\u6b65\u7684\u7cfb\u7edf\u642d\u5efa\u3002<\/p>\n<p><strong>\u6709\u54ea\u4e9b\u5e93\u6216\u5de5\u5177\u53ef\u4ee5\u5e2e\u52a9\u6211\u5b9e\u73b0\u6536\u94f6\u7cfb\u7edf\u7684\u529f\u80fd\uff1f<\/strong><br \/>\u5728\u5f00\u53d1\u6536\u94f6\u7cfb\u7edf\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cdPython\u5e93\u6765\u7b80\u5316\u5de5\u4f5c\u3002\u4f8b\u5982\uff0cPandas\u5e93\u975e\u5e38\u9002\u5408\u7528\u4e8e\u6570\u636e\u5904\u7406\u548c\u5206\u6790\uff0c\u5e2e\u52a9\u751f\u6210\u9500\u552e\u62a5\u8868\u3002Tkinter\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u56fe\u5f62\u7528\u6237\u754c\u9762\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002\u6b64\u5916\uff0c\u4f7f\u7528SQLAlchemy\u53ef\u4ee5\u65b9\u4fbf\u5730\u4e0e\u6570\u636e\u5e93\u8fdb\u884c\u4ea4\u4e92\uff0c\u5904\u7406\u6570\u636e\u7684\u589e\u5220\u6539\u67e5\u64cd\u4f5c\u3002\u8fd9\u4e9b\u5de5\u5177\u548c\u5e93\u5c06\u6781\u5927\u5730\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<p><strong>\u5982\u4f55\u786e\u4fdd\u6536\u94f6\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u548c\u6570\u636e\u4fdd\u62a4\uff1f<\/strong><br \/>\u4e3a\u4e86\u4fdd\u8bc1\u6536\u94f6\u7cfb\u7edf\u7684\u5b89\u5168\u6027\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u7528\u6237\u6570\u636e\u7684\u52a0\u5bc6\u5b58\u50a8\u3002\u53ef\u4ee5\u4f7f\u7528Hashlib\u5e93\u5bf9\u654f\u611f\u4fe1\u606f\u8fdb\u884c\u52a0\u5bc6\uff0c\u4fdd\u62a4\u7528\u6237\u9690\u79c1\u3002\u6b64\u5916\uff0c\u5b9a\u671f\u66f4\u65b0\u7cfb\u7edf\uff0c\u4fee\u8865\u6f0f\u6d1e\u4e5f\u662f\u5fc5\u8981\u7684\u3002\u540c\u65f6\uff0c\u8bbe\u7f6e\u5408\u7406\u7684\u6743\u9650\u7ba1\u7406\uff0c\u786e\u4fdd\u53ea\u6709\u6388\u6743\u7528\u6237\u80fd\u591f\u8bbf\u95ee\u654f\u611f\u6570\u636e\u3002\u6700\u540e\uff0c\u5b9a\u671f\u5907\u4efd\u6570\u636e\u5e93\uff0c\u9632\u6b62\u6570\u636e\u4e22\u5931\u6216\u635f\u574f\uff0c\u786e\u4fdd\u7cfb\u7edf\u7684\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u56fe\u5f62\u7528\u6237\u754c\u9762\uff08GUI\uff09\u5e93\u3001\u6570\u636e\u5e93\u4ee5\u53caPython\u81ea\u8eab\u7684\u529f\u80fd\u6765\u6784\u5efa\u4e00\u4e2a\u6536\u94f6\u7cfb\u7edf\u3001\u5176\u4e2d\u5305\u62ec [&hellip;]","protected":false},"author":3,"featured_media":1181903,"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\/1181898"}],"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=1181898"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1181898\/revisions"}],"predecessor-version":[{"id":1181908,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1181898\/revisions\/1181908"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1181903"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1181898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1181898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1181898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}