{"id":1118632,"date":"2025-01-08T18:37:12","date_gmt":"2025-01-08T10:37:12","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1118632.html"},"modified":"2025-01-08T18:37:14","modified_gmt":"2025-01-08T10:37:14","slug":"python%e5%a6%82%e4%bd%95%e8%b0%83%e7%94%a8%e6%95%b0%e6%8d%ae%e5%ba%93%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1118632.html","title":{"rendered":"python\u5982\u4f55\u8c03\u7528\u6570\u636e\u5e93\u6570\u636e\u7c7b\u578b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082047\/27bf9627-c0a7-4128-8f33-eea5660a299e.webp\" alt=\"python\u5982\u4f55\u8c03\u7528\u6570\u636e\u5e93\u6570\u636e\u7c7b\u578b\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u8c03\u7528\u6570\u636e\u5e93\u6570\u636e\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\uff1a<strong>\u4f7f\u7528SQLite\u3001\u4f7f\u7528MySQL\u3001\u4f7f\u7528PostgreSQL<\/strong>\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u8fde\u63a5\u548c\u64cd\u4f5c\u6570\u636e\u5e93\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528SQLite<\/p>\n<\/p>\n<p><p>SQLite\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u5d4c\u5165\u5f0f\u6570\u636e\u5e93\uff0c\u5b83\u4e0d\u9700\u8981\u5355\u72ec\u7684\u670d\u52a1\u5668\u8fdb\u7a0b\uff0c\u5e76\u4e14\u4e0ePython\u6807\u51c6\u5e93\u4e00\u8d77\u63d0\u4f9b\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528SQLite\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165sqlite3\u6a21\u5757<\/strong>  <\/li>\n<li><strong>\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff08\u5982\u679c\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5c06\u81ea\u52a8\u521b\u5efa\uff09<\/strong>  <\/li>\n<li><strong>\u521b\u5efa\u6e38\u6807\u5bf9\u8c61\u4ee5\u6267\u884cSQL\u8bed\u53e5<\/strong>  <\/li>\n<li><strong>\u6267\u884cSQL\u67e5\u8be2\u548c\u64cd\u4f5c<\/strong>  <\/li>\n<li><strong>\u63d0\u4ea4\u4e8b\u52a1\uff08\u5bf9\u4e8e\u6570\u636e\u5199\u64cd\u4f5c\uff09<\/strong>  <\/li>\n<li><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import sqlite3<\/p>\n<h2><strong>\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff08\u5982\u679c\u6570\u636e\u5e93\u4e0d\u5b58\u5728\uff0c\u5c06\u81ea\u52a8\u521b\u5efa\uff09<\/strong><\/h2>\n<p>conn = sqlite3.connect(&#39;example.db&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u6e38\u6807\u5bf9\u8c61<\/strong><\/h2>\n<p>cur = conn.cursor()<\/p>\n<h2><strong>\u521b\u5efa\u8868<\/strong><\/h2>\n<p>cur.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT, age INTEGER)&#39;&#39;&#39;)<\/p>\n<h2><strong>\u63d2\u5165\u6570\u636e<\/strong><\/h2>\n<p>cur.execute(&quot;INSERT INTO users (name, age) VALUES (?, ?)&quot;, (&#39;Alice&#39;, 30))<\/p>\n<h2><strong>\u63d0\u4ea4\u4e8b\u52a1<\/strong><\/h2>\n<p>conn.commit()<\/p>\n<h2><strong>\u67e5\u8be2\u6570\u636e<\/strong><\/h2>\n<p>cur.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>rows = cur.fetchall()<\/p>\n<p>for row in rows:<\/p>\n<p>    print(row)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528MySQL<\/p>\n<\/p>\n<p><p>\u8981\u4f7f\u7528MySQL\u6570\u636e\u5e93\uff0c\u9700\u8981\u5b89\u88c5MySQL Connector\/Python\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install mysql-connector-python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4f7f\u7528MySQL\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165mysql.connector\u6a21\u5757<\/strong>  <\/li>\n<li><strong>\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93<\/strong>  <\/li>\n<li><strong>\u521b\u5efa\u6e38\u6807\u5bf9\u8c61\u4ee5\u6267\u884cSQL\u8bed\u53e5<\/strong>  <\/li>\n<li><strong>\u6267\u884cSQL\u67e5\u8be2\u548c\u64cd\u4f5c<\/strong>  <\/li>\n<li><strong>\u63d0\u4ea4\u4e8b\u52a1\uff08\u5bf9\u4e8e\u6570\u636e\u5199\u64cd\u4f5c\uff09<\/strong>  <\/li>\n<li><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import mysql.connector<\/p>\n<h2><strong>\u8fde\u63a5\u5230MySQL\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = mysql.connector.connect(<\/p>\n<p>    host=&quot;localhost&quot;,<\/p>\n<p>    user=&quot;yourusername&quot;,<\/p>\n<p>    password=&quot;yourpassword&quot;,<\/p>\n<p>    database=&quot;yourdatabase&quot;<\/p>\n<p>)<\/p>\n<h2><strong>\u521b\u5efa\u6e38\u6807\u5bf9\u8c61<\/strong><\/h2>\n<p>cur = conn.cursor()<\/p>\n<h2><strong>\u521b\u5efa\u8868<\/strong><\/h2>\n<p>cur.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), age INT)&#39;&#39;&#39;)<\/p>\n<h2><strong>\u63d2\u5165\u6570\u636e<\/strong><\/h2>\n<p>cur.execute(&quot;INSERT INTO users (name, age) VALUES (%s, %s)&quot;, (&#39;Bob&#39;, 25))<\/p>\n<h2><strong>\u63d0\u4ea4\u4e8b\u52a1<\/strong><\/h2>\n<p>conn.commit()<\/p>\n<h2><strong>\u67e5\u8be2\u6570\u636e<\/strong><\/h2>\n<p>cur.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>rows = cur.fetchall()<\/p>\n<p>for row in rows:<\/p>\n<p>    print(row)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528PostgreSQL<\/p>\n<\/p>\n<p><p>\u8981\u4f7f\u7528PostgreSQL\u6570\u636e\u5e93\uff0c\u9700\u8981\u5b89\u88c5psycopg2\u5e93\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install psycopg2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4f7f\u7528PostgreSQL\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5bfc\u5165psycopg2\u6a21\u5757<\/strong>  <\/li>\n<li><strong>\u8fde\u63a5\u5230PostgreSQL\u6570\u636e\u5e93<\/strong>  <\/li>\n<li><strong>\u521b\u5efa\u6e38\u6807\u5bf9\u8c61\u4ee5\u6267\u884cSQL\u8bed\u53e5<\/strong>  <\/li>\n<li><strong>\u6267\u884cSQL\u67e5\u8be2\u548c\u64cd\u4f5c<\/strong>  <\/li>\n<li><strong>\u63d0\u4ea4\u4e8b\u52a1\uff08\u5bf9\u4e8e\u6570\u636e\u5199\u64cd\u4f5c\uff09<\/strong>  <\/li>\n<li><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import psycopg2<\/p>\n<h2><strong>\u8fde\u63a5\u5230PostgreSQL\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = psycopg2.connect(<\/p>\n<p>    host=&quot;localhost&quot;,<\/p>\n<p>    database=&quot;yourdatabase&quot;,<\/p>\n<p>    user=&quot;yourusername&quot;,<\/p>\n<p>    password=&quot;yourpassword&quot;<\/p>\n<p>)<\/p>\n<h2><strong>\u521b\u5efa\u6e38\u6807\u5bf9\u8c61<\/strong><\/h2>\n<p>cur = conn.cursor()<\/p>\n<h2><strong>\u521b\u5efa\u8868<\/strong><\/h2>\n<p>cur.execute(&#39;&#39;&#39;CREATE TABLE IF NOT EXISTS users (id SERIAL PRIMARY KEY, name VARCHAR(255), age INT)&#39;&#39;&#39;)<\/p>\n<h2><strong>\u63d2\u5165\u6570\u636e<\/strong><\/h2>\n<p>cur.execute(&quot;INSERT INTO users (name, age) VALUES (%s, %s)&quot;, (&#39;Charlie&#39;, 35))<\/p>\n<h2><strong>\u63d0\u4ea4\u4e8b\u52a1<\/strong><\/h2>\n<p>conn.commit()<\/p>\n<h2><strong>\u67e5\u8be2\u6570\u636e<\/strong><\/h2>\n<p>cur.execute(&quot;SELECT * FROM users&quot;)<\/p>\n<p>rows = cur.fetchall()<\/p>\n<p>for row in rows:<\/p>\n<p>    print(row)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528ORM\uff08\u5982SQLAlchemy\uff09<\/p>\n<\/p>\n<p><p>SQLAlchemy\u662f\u4e00\u4e2a\u975e\u5e38\u6d41\u884c\u7684ORM\uff08\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff09\u5e93\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528Python\u7c7b\u6765\u8868\u793a\u6570\u636e\u5e93\u8868\uff0c\u5e76\u901a\u8fc7\u8fd9\u4e9b\u7c7b\u6765\u6267\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528SQLAlchemy\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5SQLAlchemy\u5e93\uff1a<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install sqlalchemy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u5b9a\u4e49\u6a21\u578b\u7c7b\uff1a<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">from sqlalchemy import create_engine, Column, Integer, String<\/p>\n<p>from sqlalchemy.ext.declarative import declarative_base<\/p>\n<p>from sqlalchemy.orm import sessionmaker<\/p>\n<p>Base = declarative_base()<\/p>\n<p>class User(Base):<\/p>\n<p>    __tablename__ = &#39;users&#39;<\/p>\n<p>    id = Column(Integer, primary_key=True)<\/p>\n<p>    name = Column(String)<\/p>\n<p>    age = Column(Integer)<\/p>\n<h2><strong>\u521b\u5efa\u6570\u636e\u5e93\u5f15\u64ce<\/strong><\/h2>\n<p>engine = create_engine(&#39;sqlite:\/\/\/example.db&#39;)<\/p>\n<h2><strong>\u521b\u5efa\u8868<\/strong><\/h2>\n<p>Base.metadata.create_all(engine)<\/p>\n<h2><strong>\u521b\u5efa\u4f1a\u8bdd<\/strong><\/h2>\n<p>Session = sessionmaker(bind=engine)<\/p>\n<p>session = Session()<\/p>\n<h2><strong>\u63d2\u5165\u6570\u636e<\/strong><\/h2>\n<p>new_user = User(name=&#39;David&#39;, age=40)<\/p>\n<p>session.add(new_user)<\/p>\n<p>session.commit()<\/p>\n<h2><strong>\u67e5\u8be2\u6570\u636e<\/strong><\/h2>\n<p>users = session.query(User).all()<\/p>\n<p>for user in users:<\/p>\n<p>    print(user.name, user.age)<\/p>\n<h2><strong>\u5173\u95ed\u4f1a\u8bdd<\/strong><\/h2>\n<p>session.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u4f7f\u7528Pandas\u4e0eSQL<\/p>\n<\/p>\n<p><p>Pandas\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u5e93\uff0c\u53ef\u4ee5\u4e0eSQL\u6570\u636e\u5e93\u914d\u5408\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Pandas\u4eceSQL\u6570\u636e\u5e93\u8bfb\u53d6\u548c\u5199\u5165\u6570\u636e\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u5b89\u88c5Pandas\u5e93\uff1a<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-bash\">pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8bfb\u53d6\u548c\u5199\u5165\u6570\u636e\uff1a<\/strong><\/li>\n<\/ol>\n<p><pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>import sqlite3<\/p>\n<h2><strong>\u8fde\u63a5\u5230SQLite\u6570\u636e\u5e93<\/strong><\/h2>\n<p>conn = sqlite3.connect(&#39;example.db&#39;)<\/p>\n<h2><strong>\u8bfb\u53d6\u6570\u636e\u5230DataFrame<\/strong><\/h2>\n<p>df = pd.read_sql_query(&quot;SELECT * FROM users&quot;, conn)<\/p>\n<p>print(df)<\/p>\n<h2><strong>\u5199\u5165\u6570\u636e\u5230\u6570\u636e\u5e93<\/strong><\/h2>\n<p>data = {&#39;name&#39;: [&#39;Eva&#39;, &#39;Frank&#39;], &#39;age&#39;: [45, 50]}<\/p>\n<p>new_df = pd.DataFrame(data)<\/p>\n<p>new_df.to_sql(&#39;users&#39;, conn, if_exists=&#39;append&#39;, index=False)<\/p>\n<h2><strong>\u5173\u95ed\u8fde\u63a5<\/strong><\/h2>\n<p>conn.close()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u65b9\u4fbf\u5730\u8c03\u7528\u548c\u64cd\u4f5c\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u5e93\u3002\u6bcf\u79cd\u65b9\u6cd5\u90fd\u6709\u5176\u4f18\u70b9\u548c\u9002\u7528\u573a\u666f\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u6570\u636e\u5e93\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\uff0c\u9009\u62e9\u5408\u9002\u7684\u6570\u636e\u5e93\u548c\u5e93\u6765\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u662f\u975e\u5e38\u91cd\u8981\u7684\u3002SQLite\u9002\u7528\u4e8e\u8f7b\u91cf\u7ea7\u5e94\u7528\u548c\u539f\u578b\u5f00\u53d1\uff0cMySQL\u548cPostgreSQL\u9002\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u4e2d\u7684\u4e2d\u5927\u578b\u5e94\u7528\uff0cSQLAlchemy\u9002\u7528\u4e8e\u66f4\u590d\u6742\u7684ORM\u64cd\u4f5c\uff0cPandas\u5219\u9002\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u5904\u7406\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u4e3a\u60a8\u5728Python\u4e2d\u8c03\u7528\u6570\u636e\u5e93\u6570\u636e\u63d0\u4f9b\u4e00\u4e9b\u6709\u7528\u7684\u53c2\u8003\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8fde\u63a5\u5230\u6570\u636e\u5e93\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u5e93\u8fde\u63a5\u5230\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u5e93\uff0c\u5982SQLite\u3001MySQL\u3001PostgreSQL\u7b49\u3002\u4e00\u822c\u6b65\u9aa4\u5305\u62ec\uff1a\u5bfc\u5165\u76f8\u5e94\u7684\u6570\u636e\u5e93\u9a71\u52a8\u5e93\uff0c\u4f7f\u7528\u8fde\u63a5\u51fd\u6570\u5efa\u7acb\u8fde\u63a5\uff0c\u521b\u5efa\u6e38\u6807\u5bf9\u8c61\u4ee5\u6267\u884cSQL\u67e5\u8be2\uff0c\u6700\u540e\u5173\u95ed\u8fde\u63a5\u3002\u5bf9\u4e8eSQLite\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684sqlite3\u6a21\u5757\uff1b\u5bf9\u4e8eMySQL\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528mysql-connector-python\u6216PyMySQL\u5e93\u3002<\/p>\n<p><strong>Python\u652f\u6301\u54ea\u4e9b\u6570\u636e\u5e93\u6570\u636e\u7c7b\u578b\uff1f<\/strong><br \/>Python\u4e0e\u6570\u636e\u5e93\u4ea4\u4e92\u65f6\uff0c\u5e38\u89c1\u7684\u6570\u636e\u7c7b\u578b\u5305\u62ec\u6574\u6570\uff08int\uff09\u3001\u6d6e\u70b9\u6570\uff08float\uff09\u3001\u5b57\u7b26\u4e32\uff08str\uff09\u3001\u5e03\u5c14\u503c\uff08bool\uff09\u4ee5\u53ca\u65e5\u671f\u548c\u65f6\u95f4\uff08datetime\uff09\u3002\u5728\u5c06\u6570\u636e\u63d2\u5165\u6570\u636e\u5e93\u65f6\uff0cPython\u7684\u6570\u636e\u7c7b\u578b\u4f1a\u81ea\u52a8\u6620\u5c04\u5230\u6570\u636e\u5e93\u652f\u6301\u7684\u5bf9\u5e94\u7c7b\u578b\uff0c\u5982\u5c06Python\u7684\u5b57\u7b26\u4e32\u6620\u5c04\u4e3a\u6570\u636e\u5e93\u4e2d\u7684VARCHAR\u7c7b\u578b\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406Python\u4e0e\u6570\u636e\u5e93\u4e4b\u95f4\u7684\u6570\u636e\u8f6c\u6362\uff1f<\/strong><br \/>\u5728\u8fdb\u884c\u6570\u636e\u63d2\u5165\u6216\u67e5\u8be2\u65f6\uff0cPython\u548c\u6570\u636e\u5e93\u4e4b\u95f4\u7684\u6570\u636e\u8f6c\u6362\u662f\u4e00\u4e2a\u91cd\u8981\u8fc7\u7a0b\u3002\u53ef\u4ee5\u4f7f\u7528Python\u7684\u5185\u7f6e\u51fd\u6570\u548c\u5e93\u6765\u5904\u7406\u8fd9\u79cd\u8f6c\u6362\u3002\u4f8b\u5982\uff0c\u5f53\u4ece\u6570\u636e\u5e93\u4e2d\u8bfb\u53d6\u65e5\u671f\u65f6\u95f4\u6570\u636e\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528datetime\u6a21\u5757\u6765\u683c\u5f0f\u5316\u8f93\u51fa\u3002\u800c\u5728\u63d2\u5165\u6570\u636e\u65f6\uff0c\u786e\u4fdd\u5c06Python\u5bf9\u8c61\u8f6c\u6362\u4e3a\u6570\u636e\u5e93\u8ba4\u53ef\u7684\u683c\u5f0f\uff0c\u4ee5\u907f\u514d\u7c7b\u578b\u4e0d\u5339\u914d\u9519\u8bef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u8c03\u7528\u6570\u636e\u5e93\u6570\u636e\u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u5e38\u89c1\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528SQLite\u3001\u4f7f\u7528MySQL\u3001\u4f7f\u7528Postgre [&hellip;]","protected":false},"author":3,"featured_media":1118640,"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\/1118632"}],"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=1118632"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1118632\/revisions"}],"predecessor-version":[{"id":1118645,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1118632\/revisions\/1118645"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1118640"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1118632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1118632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1118632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}