{"id":300703,"date":"2024-05-20T17:49:30","date_gmt":"2024-05-20T09:49:30","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/300703.html"},"modified":"2024-05-20T17:49:54","modified_gmt":"2024-05-20T09:49:54","slug":"%e5%a6%82%e4%bd%95%e7%94%a8-python-%e7%bc%96%e4%b8%80%e4%b8%aa%e8%b4%aa%e5%90%83%e8%9b%87%e5%b0%8f%e6%b8%b8%e6%88%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/300703.html","title":{"rendered":"\u5982\u4f55\u7528 python \u7f16\u4e00\u4e2a\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26212935\/7834a020-2229-4241-a670-77f1bd420755.webp\" alt=\"\u5982\u4f55\u7528 python \u7f16\u4e00\u4e2a\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f\" \/><\/p>\n<p><p>\u8d2a\u5403\u86c7\u662f\u4e00\u6b3e\u975e\u5e38\u7ecf\u5178\u7684\u6e38\u620f\uff0c\u5728Python\u4e2d\u7f16\u5199\u8d2a\u5403\u86c7\u6e38\u620f\u4e0d\u4ec5\u80fd\u591f\u953b\u70bc\u7f16\u7a0b\u6280\u80fd\uff0c\u8fd8\u80fd\u5bf9\u56fe\u5f62\u7528\u6237\u754c\u9762\u7f16\u7a0b\u6709\u4e00\u4e2a\u521d\u6b65\u4e86\u89e3\u3002<strong>\u4f7f\u7528Python\u7f16\u7a0b\u8bed\u8a00\u3001\u7ed3\u5408Pygame\u5e93\u5373\u53ef\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f<\/strong>\u3002Pygame\u5e93\u63d0\u4f9b\u4e86\u5f00\u53d1\u6e38\u620f\u6240\u9700\u7684\u6a21\u5757\uff0c\u5982\u6e32\u67d3\u56fe\u50cf\u3001\u5904\u7406\u4e8b\u4ef6\u3001\u63a7\u5236\u6e38\u620f\u5e27\u7387\u7b49\u3002<\/p>\n<\/p>\n<p><p><strong>\u5177\u4f53\u6b65\u9aa4\u6d89\u53ca\u8bbe\u5b9a\u6e38\u620f\u7a97\u53e3\u3001\u5904\u7406\u4e8b\u4ef6\u5faa\u73af\u3001\u7ed8\u5236\u86c7\u8eab\u548c\u98df\u7269\u3001\u4ee5\u53ca\u5904\u7406\u86c7\u7684\u79fb\u52a8\u548c\u589e\u957f\u673a\u5236\u3002<\/strong> \u4e0b\u9762\u8be6\u7ec6\u9610\u8ff0\u5982\u4f55\u5206\u6b65\u9aa4\u4f7f\u7528Python\u7f16\u5199\u8d2a\u5403\u86c7\u6e38\u620f\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5PYGAME\u5e93<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5Pygame\u5e93\uff0c\u8fd9\u662fPython\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u4e13\u95e8\u7528\u4e8e\u7f16\u5199\u6e38\u620f\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pygame<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e8c\u3001\u8bbe\u7f6e\u6e38\u620f\u73af\u5883<\/h3>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u4ee3\u7801\u4e4b\u524d\uff0c\u9700\u5148\u8fdb\u884c\u6e38\u620f\u73af\u5883\u7684\u8bbe\u7f6e\u3002\u8fd9\u5305\u62ec\u521d\u59cb\u5316Pygame\u6a21\u5757\u3001\u8bbe\u7f6e\u6e38\u620f\u7a97\u53e3\u7684\u5927\u5c0f\u3001\u5b9a\u4e49\u6e38\u620f\u4e2d\u4f7f\u7528\u7684\u989c\u8272\u4ee5\u53ca\u8bbe\u7f6e\u6e38\u620f\u7684\u5e27\u7387\uff08FPS\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import pygame<\/p>\n<p>import sys<\/p>\n<p>import random<\/p>\n<h2><strong>\u521d\u59cb\u5316Pygame<\/strong><\/h2>\n<p>pygame.init()<\/p>\n<h2><strong>\u5b9a\u4e49\u989c\u8272<\/strong><\/h2>\n<p>BLACK = pygame.Color(0, 0, 0)<\/p>\n<p>WHITE = pygame.Color(255, 255, 255)<\/p>\n<p>RED = pygame.Color(255, 0, 0)<\/p>\n<p>GREEN = pygame.Color(0, 255, 0)<\/p>\n<h2><strong>\u8bbe\u7f6e\u6e38\u620f\u7a97\u53e3\u5927\u5c0f<\/strong><\/h2>\n<p>SCREEN_WIDTH = 600<\/p>\n<p>SCREEN_HEIGHT = 400<\/p>\n<p>screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))<\/p>\n<h2><strong>\u8bbe\u7f6e\u6e38\u620f\u6807\u9898<\/strong><\/h2>\n<p>pygame.display.set_caption(&#039;Python \u8d2a\u5403\u86c7\u6e38\u620f&#039;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u5e27\u7387<\/strong><\/h2>\n<p>FPS = 15<\/p>\n<p>fps_clock = pygame.time.Clock()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u5b9a\u4e49\u86c7\u548c\u98df\u7269\u7684\u6570\u636e\u7ed3\u6784<\/h3>\n<\/p>\n<p><p>\u5728\u6e38\u620f\u4e2d\uff0c\u86c7\u662f\u7531\u4e00\u4e2a\u4e2a\u5c0f\u65b9\u5757\u7ec4\u6210\u7684\uff0c\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u5217\u8868\u6765\u7ef4\u62a4\u8fd9\u4e9b\u65b9\u5757\u7684\u4f4d\u7f6e\u3002\u540c\u6837\u5730\uff0c\u98df\u7269\u4e5f\u53ef\u4ee5\u7528\u5750\u6807\u6765\u5b9a\u4e49\u5176\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u86c7\u7684\u521d\u59cb\u4f4d\u7f6e\u548c\u957f\u5ea6<\/p>\n<p>snake_pos = [100, 50]<\/p>\n<p>snake_body = [[100, 50], [90, 50], [80, 50]]<\/p>\n<h2><strong>\u98df\u7269\u7684\u968f\u673a\u4f4d\u7f6e<\/strong><\/h2>\n<p>food_pos = [random.randrange(1, (SCREEN_WIDTH\/\/10)) * 10, <\/p>\n<p>            random.randrange(1, (SCREEN_HEIGHT\/\/10)) * 10]<\/p>\n<p>food_spawn = True<\/p>\n<h2><strong>\u8bbe\u7f6e\u86c7\u7684\u521d\u59cb\u65b9\u5411<\/strong><\/h2>\n<p>direction = &#039;RIGHT&#039;<\/p>\n<p>change_to = direction<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u56db\u3001\u6e38\u620f\u4e8b\u4ef6\u5faa\u73af<\/h3>\n<\/p>\n<p><p>\u5728\u6e38\u620f\u7684\u4e3b\u5faa\u73af\u4e2d\uff0c\u5904\u7406\u5404\u79cd\u7528\u6237\u4e8b\u4ef6\uff0c\u5305\u62ec\u952e\u76d8\u8f93\u5165\u3001\u7a97\u53e3\u5173\u95ed\u7b49\uff0c\u5e76\u6839\u636e\u7528\u6237\u8f93\u5165\u6765\u6539\u53d8\u86c7\u7684\u79fb\u52a8\u65b9\u5411\u3002\u540c\u65f6\uff0c\u6e38\u620f\u5faa\u73af\u4e5f\u4f1a\u8d1f\u8d23\u6e32\u67d3\u6e38\u620f\u754c\u9762\u3001\u66f4\u65b0\u86c7\u548c\u98df\u7269\u7684\u4f4d\u7f6e\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6e38\u620f\u4e3b\u5faa\u73af<\/p>\n<p>while True:<\/p>\n<p>    for event in pygame.event.get():<\/p>\n<p>        if event.type == pygame.QUIT:<\/p>\n<p>            pygame.quit()<\/p>\n<p>            sys.exit()<\/p>\n<p>        # \u68c0\u6d4b\u6309\u952e\u4e8b\u4ef6\u6765\u6539\u53d8\u65b9\u5411<\/p>\n<p>        elif event.type == pygame.KEYDOWN:<\/p>\n<p>            if event.key == pygame.K_RIGHT or event.key == ord(&#039;d&#039;):<\/p>\n<p>                change_to = &#039;RIGHT&#039;<\/p>\n<p>            if event.key == pygame.K_LEFT or event.key == ord(&#039;a&#039;):<\/p>\n<p>                change_to = &#039;LEFT&#039;<\/p>\n<p>            if event.key == pygame.K_UP or event.key == ord(&#039;w&#039;):<\/p>\n<p>                change_to = &#039;UP&#039;<\/p>\n<p>            if event.key == pygame.K_DOWN or event.key == ord(&#039;s&#039;):<\/p>\n<p>                change_to = &#039;DOWN&#039;<\/p>\n<p>    # \u786e\u4fdd\u86c7\u4e0d\u4f1a\u76f4\u63a5\u53cd\u5411\u79fb\u52a8<\/p>\n<p>    if change_to == &#039;RIGHT&#039; and not direction == &#039;LEFT&#039;:<\/p>\n<p>        direction = &#039;RIGHT&#039;<\/p>\n<p>    if change_to == &#039;LEFT&#039; and not direction == &#039;RIGHT&#039;:<\/p>\n<p>        direction = &#039;LEFT&#039;<\/p>\n<p>    if change_to == &#039;UP&#039; and not direction == &#039;DOWN&#039;:<\/p>\n<p>        direction = &#039;UP&#039;<\/p>\n<p>    if change_to == &#039;DOWN&#039; and not direction == &#039;UP&#039;:<\/p>\n<p>        direction = &#039;DOWN&#039;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u7ed8\u5236\u86c7\u548c\u98df\u7269<\/h3>\n<\/p>\n<p><p>\u5728\u86c7\u7684\u6bcf\u4e00\u6b21\u79fb\u52a8\u4e4b\u540e\uff0c\u9700\u91cd\u65b0\u7ed8\u5236\u86c7\u7684\u8eab\u4f53\u4ee5\u53ca\u98df\u7269\u3002\u5f53\u86c7\u5403\u5230\u98df\u7269\u65f6\uff0c\u8eab\u4f53\u4f1a\u53d8\u957f\uff0c\u98df\u7269\u4f1a\u91cd\u65b0\u5728\u7a97\u53e3\u7684\u968f\u673a\u4f4d\u7f6e\u751f\u6210\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">    # \u79fb\u52a8\u86c7\u5934\u7684\u5750\u6807<\/p>\n<p>    if direction == &#039;RIGHT&#039;:<\/p>\n<p>        snake_pos[0] += 10<\/p>\n<p>    if direction == &#039;LEFT&#039;:<\/p>\n<p>        snake_pos[0] -= 10<\/p>\n<p>    if direction == &#039;UP&#039;:<\/p>\n<p>        snake_pos[1] -= 10<\/p>\n<p>    if direction == &#039;DOWN&#039;:<\/p>\n<p>        snake_pos[1] += 10<\/p>\n<p>    # \u86c7\u8eab\u4f53\u589e\u52a0\u4e00\u8282<\/p>\n<p>    snake_body.insert(0, list(snake_pos))<\/p>\n<p>    # \u5982\u679c\u86c7\u5403\u5230\u98df\u7269<\/p>\n<p>    if snake_pos[0] == food_pos[0] and snake_pos[1] == food_pos[1]:<\/p>\n<p>        food_spawn = False<\/p>\n<p>    else:<\/p>\n<p>        snake_body.pop()<\/p>\n<p>    # \u5982\u679c\u98df\u7269\u88ab\u5403\u6389<\/p>\n<p>    if not food_spawn:<\/p>\n<p>        food_pos = [random.randrange(1, (SCREEN_WIDTH\/\/10)) * 10, random.randrange(1, (SCREEN_HEIGHT\/\/10)) * 10]<\/p>\n<p>    food_spawn = True<\/p>\n<p>    # \u7ed8\u5236Pygame\u7684\u663e\u793a\u5c42<\/p>\n<p>    screen.fill(BLACK)<\/p>\n<p>    # \u7ed8\u5236\u98df\u7269<\/p>\n<p>    pygame.draw.rect(screen, RED, pygame.Rect(food_pos[0], food_pos[1], 10, 10))<\/p>\n<p>    # \u7ed8\u5236\u86c7<\/p>\n<p>    for pos in snake_body:<\/p>\n<p>        pygame.draw.rect(screen, GREEN, pygame.Rect(pos[0], pos[1], 10, 10))<\/p>\n<p>    # \u5237\u65b0Pygame\u663e\u793a\u5c42<\/p>\n<p>    pygame.display.flip()<\/p>\n<p>    # \u63a7\u5236\u6e38\u620f\u5e27\u7387<\/p>\n<p>    fps_clock.tick(FPS)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u5904\u7406\u6e38\u620f\u7ed3\u675f\u7684\u60c5\u5f62<\/h3>\n<\/p>\n<p><p>\u6e38\u620f\u7ed3\u675f\u7684\u60c5\u51b5\u6709\u4e24\u79cd\uff1a\u86c7\u649e\u5230\u5899\u58c1\u6216\u86c7\u5934\u649e\u5230\u81ea\u5df1\u7684\u8eab\u4f53\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b,\u9700\u8981\u5224\u65ad\u5e76\u7ed3\u675f\u6e38\u620f\u5faa\u73af\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">    # \u68c0\u67e5\u86c7\u662f\u5426\u649e\u5899<\/p>\n<p>    if snake_pos[0] &lt; 0 or snake_pos[0] &gt; SCREEN_WIDTH-10:<\/p>\n<p>        pygame.quit()<\/p>\n<p>        sys.exit()<\/p>\n<p>    if snake_pos[1] &lt; 0 or snake_pos[1] &gt; SCREEN_HEIGHT-10:<\/p>\n<p>        pygame.quit()<\/p>\n<p>        sys.exit()<\/p>\n<p>    # \u68c0\u67e5\u86c7\u662f\u5426\u649e\u81ea\u5df1<\/p>\n<p>    for block in snake_body[1:]:<\/p>\n<p>        if snake_pos == block:<\/p>\n<p>            pygame.quit()<\/p>\n<p>            sys.exit()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4ee5\u4e0a\u662f\u7528Python\u7f16\u5199\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f\u7684\u8fc7\u7a0b\u3002\u901a\u8fc7\u7ec6\u5206\u6b65\u9aa4\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u6bcf\u4e00\u6b65\u5b9e\u9645\u4e0a\u90fd\u4e0d\u590d\u6742\uff0c\u4f46\u662f\u7ec4\u5408\u8d77\u6765\u5c31\u6784\u6210\u4e86\u4e00\u4e2a\u6709\u8da3\u7684\u6e38\u620f\u3002\u901a\u8fc7\u638c\u63e1\u57fa\u672c\u7684\u6e38\u620f\u5f00\u53d1\u539f\u7406\u548cPython\u7f16\u7a0b\u77e5\u8bc6\uff0c\u4f60\u53ef\u4ee5\u8fdb\u4e00\u6b65\u7684\u4f18\u5316\u8fd9\u4e2a\u6e38\u620f\uff0c\u4f8b\u5982\u589e\u52a0\u8ba1\u5206\u673a\u5236\u3001\u589e\u5f3a\u6e38\u620f\u96be\u5ea6\u6216\u8005\u6539\u5584\u56fe\u5f62\u754c\u9762\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>\u5982\u4f55\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f\uff1f<\/strong><\/p>\n<p>\u7f16\u5199\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f\u53ef\u4ee5\u4f7f\u7528 Python \u7684 Pygame \u5e93\u6765\u5b9e\u73b0\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5316\u7684\u6b65\u9aa4\u6307\u5357\uff1a<\/p>\n<p><strong>\u6b65\u9aa4 1\uff1a\u5b89\u88c5 Pygame<\/strong><br \/>\n\u5728\u5f00\u59cb\u7f16\u5199\u8d2a\u5403\u86c7\u6e38\u620f\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u5b89\u88c5 Pygame \u5e93\u3002\u4f7f\u7528\u547d\u4ee4 <code>pip install pygame<\/code> \u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u5b89\u88c5\u3002<\/p>\n<p><strong>\u6b65\u9aa4 2\uff1a\u5bfc\u5165 Pygame \u6a21\u5757<\/strong><br \/>\n\u5728\u7f16\u5199\u4ee3\u7801\u4e4b\u524d\uff0c\u9700\u8981\u5bfc\u5165 Pygame \u6a21\u5757\uff0c\u4ee5\u4fbf\u4f7f\u7528\u5176\u4e2d\u7684\u529f\u80fd\u3002\u53ef\u4ee5\u4f7f\u7528 <code>import pygame<\/code> \u6765\u5bfc\u5165\u6a21\u5757\u3002<\/p>\n<p><strong>\u6b65\u9aa4 3\uff1a\u521d\u59cb\u5316\u6e38\u620f<\/strong><br \/>\n\u901a\u8fc7\u8c03\u7528 <code>pygame.init()<\/code> \u51fd\u6570\u6765\u521d\u59cb\u5316 Pygame\u3002\u8fd9\u5c06\u521d\u59cb\u5316 Pygame \u6240\u9700\u8981\u7684\u5404\u79cd\u6a21\u5757\u548c\u8d44\u6e90\u3002<\/p>\n<p><strong>\u6b65\u9aa4 4\uff1a\u8bbe\u7f6e\u6e38\u620f\u7a97\u53e3<\/strong><br \/>\n\u4f7f\u7528 <code>pygame.display.set_mode()<\/code> \u51fd\u6570\u6765\u8bbe\u7f6e\u6e38\u620f\u7a97\u53e3\u7684\u5927\u5c0f\u548c\u663e\u793a\u6a21\u5f0f\u3002\u53ef\u4ee5\u6307\u5b9a\u7a97\u53e3\u7684\u5bbd\u5ea6\u548c\u9ad8\u5ea6\u7b49\u53c2\u6570\u3002<\/p>\n<p><strong>\u6b65\u9aa4 5\uff1a\u521b\u5efa\u8d2a\u5403\u86c7<\/strong><br \/>\n\u5728\u6e38\u620f\u7a97\u53e3\u4e0a\u521b\u5efa\u4e00\u4e2a\u8d2a\u5403\u86c7\u5bf9\u8c61\uff0c\u5e76\u8bbe\u7f6e\u5176\u521d\u59cb\u4f4d\u7f6e\u548c\u5927\u5c0f\u3002<\/p>\n<p><strong>\u6b65\u9aa4 6\uff1a\u5904\u7406\u7528\u6237\u8f93\u5165<\/strong><br \/>\n\u901a\u8fc7\u76d1\u542c\u952e\u76d8\u4e8b\u4ef6\u548c\u9f20\u6807\u4e8b\u4ef6\u6765\u83b7\u53d6\u7528\u6237\u7684\u64cd\u4f5c\u8f93\u5165\u3002\u6839\u636e\u7528\u6237\u7684\u64cd\u4f5c\u6765\u66f4\u65b0\u8d2a\u5403\u86c7\u7684\u79fb\u52a8\u65b9\u5411\u3002<\/p>\n<p><strong>\u6b65\u9aa4 7\uff1a\u66f4\u65b0\u6e38\u620f\u903b\u8f91<\/strong><br \/>\n\u6839\u636e\u8d2a\u5403\u86c7\u7684\u79fb\u52a8\u65b9\u5411\u548c\u7528\u6237\u7684\u8f93\u5165\u6765\u66f4\u65b0\u6e38\u620f\u7684\u903b\u8f91\u3002\u6bd4\u5982\uff0c\u5f53\u8d2a\u5403\u86c7\u5403\u5230\u98df\u7269\u65f6\uff0c\u8d2a\u5403\u86c7\u4f1a\u53d8\u957f\uff0c\u5e76\u751f\u6210\u65b0\u7684\u98df\u7269\u3002<\/p>\n<p><strong>\u6b65\u9aa4 8\uff1a\u7ed8\u5236\u6e38\u620f\u753b\u9762<\/strong><br \/>\n\u901a\u8fc7\u8c03\u7528\u5404\u79cd Pygame \u7684\u7ed8\u5236\u51fd\u6570\u6765\u7ed8\u5236\u6e38\u620f\u753b\u9762\u3002\u53ef\u4ee5\u4f7f\u7528 <code>pygame.draw.rect()<\/code> \u6765\u7ed8\u5236\u8d2a\u5403\u86c7\u548c\u98df\u7269\u3002<\/p>\n<p><strong>\u6b65\u9aa4 9\uff1a\u66f4\u65b0\u6e38\u620f\u663e\u793a<\/strong><br \/>\n\u5728\u6e38\u620f\u753b\u9762\u7ed8\u5236\u5b8c\u6210\u540e\uff0c\u9700\u8981\u8c03\u7528 <code>pygame.display.flip()<\/code> \u51fd\u6570\u6765\u66f4\u65b0\u6e38\u620f\u663e\u793a\u3002<\/p>\n<p><strong>\u6b65\u9aa4 10\uff1a\u8bbe\u7f6e\u6e38\u620f\u5faa\u73af<\/strong><br \/>\n\u4f7f\u7528\u4e00\u4e2a\u65e0\u9650\u5faa\u73af\u6765\u4e0d\u65ad\u66f4\u65b0\u6e38\u620f\u7684\u903b\u8f91\u3001\u7ed8\u5236\u753b\u9762\u548c\u663e\u793a\u6e38\u620f\u3002\u53ef\u4ee5\u4f7f\u7528 <code>pygame.time.Clock()<\/code> \u6765\u8bbe\u7f6e\u6e38\u620f\u7684\u5e27\u7387\u3002<\/p>\n<p>\u5e0c\u671b\u8fd9\u4e9b\u6b65\u9aa4\u5bf9\u60a8\u7f16\u5199\u8d2a\u5403\u86c7\u5c0f\u6e38\u620f\u6709\u6240\u5e2e\u52a9\uff01\u8bf7\u968f\u65f6\u63d0\u95ee\uff0c\u5982\u679c\u9700\u8981\u66f4\u591a\u5e2e\u52a9\uff0c\u6211\u4f1a\u5c3d\u529b\u89e3\u7b54\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8d2a\u5403\u86c7\u662f\u4e00\u6b3e\u975e\u5e38\u7ecf\u5178\u7684\u6e38\u620f\uff0c\u5728Python\u4e2d\u7f16\u5199\u8d2a\u5403\u86c7\u6e38\u620f\u4e0d\u4ec5\u80fd\u591f\u953b\u70bc\u7f16\u7a0b\u6280\u80fd\uff0c\u8fd8\u80fd\u5bf9\u56fe\u5f62\u7528\u6237\u754c\u9762\u7f16\u7a0b\u6709\u4e00\u4e2a\u521d [&hellip;]","protected":false},"author":3,"featured_media":300732,"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\/300703"}],"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=300703"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/300703\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/300732"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=300703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=300703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=300703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}