{"id":936427,"date":"2024-12-26T19:25:10","date_gmt":"2024-12-26T11:25:10","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/936427.html"},"modified":"2024-12-26T19:25:13","modified_gmt":"2024-12-26T11:25:13","slug":"python-%e5%a6%82%e4%bd%95%e5%ae%89%e8%a3%85turtle","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/936427.html","title":{"rendered":"python \u5982\u4f55\u5b89\u88c5turtle"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25072650\/e24be761-32f3-4371-9b84-775f05bd7c72.webp\" alt=\"python \u5982\u4f55\u5b89\u88c5turtle\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u5b89\u88c5Turtle\u5e93\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u4f60\u7684Python\u73af\u5883\u5df2\u7ecf\u914d\u7f6e\u597d\uff0c\u5b89\u88c5Turtle\u5e93\u7684\u6b65\u9aa4\u4e3b\u8981\u5305\u62ec\uff1a\u68c0\u67e5Python\u7248\u672c\u3001\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5\u3001\u9a8c\u8bc1\u5b89\u88c5\u6210\u529f\u3002<\/strong>\u5176\u4e2d\uff0c<strong>\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5<\/strong>\u662f\u6700\u5173\u952e\u7684\u4e00\u6b65\uff0c\u56e0\u4e3apip\u662fPython\u5b98\u65b9\u63a8\u8350\u7684\u5305\u7ba1\u7406\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u81ea\u52a8\u89e3\u51b3\u5305\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u786e\u4fdd\u5b89\u88c5\u7684\u5e93\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u8be6\u7ec6\u8bb2\u89e3\u8fd9\u4e9b\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u68c0\u67e5Python\u7248\u672c<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5Turtle\u5e93\u4e4b\u524d\uff0c\u9996\u5148\u8981\u786e\u4fdd\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86Python\uff0c\u5e76\u4e14Python\u7684\u7248\u672c\u4e0d\u4f4e\u4e8e3.0\u3002\u56e0\u4e3aTurtle\u5e93\u5728Python 3\u53ca\u4ee5\u4e0a\u7248\u672c\u4e2d\u5df2\u7ecf\u5305\u542b\u5728\u6807\u51c6\u5e93\u4e2d\uff0c\u6240\u4ee5\u4e0d\u9700\u8981\u989d\u5916\u5b89\u88c5\u3002\u4f46\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython 2.x\u7248\u672c\uff0c\u90a3\u4e48\u53ef\u80fd\u9700\u8981\u5347\u7ea7\u5230Python 3\u3002<\/p>\n<\/p>\n<p><h4>1. \u68c0\u67e5Python\u7248\u672c<\/h4>\n<\/p>\n<p><p>\u6253\u5f00\u547d\u4ee4\u884c\u7ec8\u7aef\uff08Windows\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff0cMac\u548cLinux\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\uff09\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5Python\u7248\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\uff0c\u5982\u679c\u7cfb\u7edf\u4e2d\u540c\u65f6\u5b89\u88c5\u4e86Python 2\u548cPython 3\uff0c\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u786e\u4fdd\u8f93\u51fa\u7684\u7248\u672c\u53f7\u662f3.x.x\uff0c\u8fd9\u8868\u660e\u4f60\u5f53\u524d\u4f7f\u7528\u7684\u662fPython 3\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5<\/h3>\n<\/p>\n<p><p>\u867d\u7136Turtle\u5e93\u5df2\u7ecf\u5305\u542b\u5728Python 3\u7684\u6807\u51c6\u5e93\u4e2d\uff0c\u4f46\u5982\u679c\u4f60\u60f3\u4f7f\u7528\u5176\u4ed6\u6269\u5c55\u529f\u80fd\u6216\u786e\u4fdd\u5e93\u7684\u5b8c\u6574\u6027\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u8fdb\u884c\u91cd\u65b0\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5pip<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u4e2d\u8fd8\u6ca1\u6709\u5b89\u88c5pip\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u5b83\uff1a<\/p>\n<\/p>\n<p><p>\u5bf9\u4e8eWindows\u7528\u6237\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python -m ensurepip --upgrade<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5bf9\u4e8eMac\u548cLinux\u7528\u6237\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m ensurepip --upgrade<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f7f\u7528pip\u5b89\u88c5Turtle\u5e93<\/h4>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5Turtle\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install PythonTurtle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\uff0c\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662fPython 3\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip3 install PythonTurtle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u5c06\u5b89\u88c5\u4e00\u4e2a\u540d\u4e3aPythonTurtle\u7684\u6269\u5c55\u5305\uff0c\u5b83\u662fTurtle\u5e93\u7684\u4e00\u4e2a\u56fe\u5f62\u5316\u754c\u9762\u7248\u672c\uff0c\u9002\u5408\u521d\u5b66\u8005\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u9a8c\u8bc1\u5b89\u88c5\u6210\u529f<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u786e\u4fddTurtle\u5e93\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u5728Python\u73af\u5883\u4e2d\u5bfc\u5165\u8be5\u5e93\u6765\u8fdb\u884c\u9a8c\u8bc1\u3002<\/p>\n<\/p>\n<p><h4>1. \u5bfc\u5165Turtle\u5e93<\/h4>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u8fdb\u5165Python\u89e3\u91ca\u5668\uff0c\u7136\u540e\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import turtle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u6ca1\u6709\u9519\u8bef\u4fe1\u606f\u51fa\u73b0\uff0c\u8bf4\u660eTurtle\u5e93\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u5e76\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h4>2. \u8fd0\u884c\u4e00\u4e2a\u7b80\u5355\u7684Turtle\u7a0b\u5e8f<\/h4>\n<\/p>\n<p><p>\u4e3a\u4e86\u8fdb\u4e00\u6b65\u9a8c\u8bc1\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\u4e00\u4e2a\u7b80\u5355\u7684Turtle\u7a0b\u5e8f\u3002\u8f93\u5165\u4ee5\u4e0b\u4ee3\u7801\u6765\u7ed8\u5236\u4e00\u4e2a\u7b80\u5355\u7684\u56fe\u5f62\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import turtle<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2aTurtle\u5bf9\u8c61<\/strong><\/h2>\n<p>t = turtle.Turtle()<\/p>\n<h2><strong>\u7ed8\u5236\u4e00\u4e2a\u56db\u8fb9\u5f62<\/strong><\/h2>\n<p>for _ in range(4):<\/p>\n<p>    t.forward(100)  # \u5411\u524d\u79fb\u52a8100\u5355\u4f4d<\/p>\n<p>    t.right(90)     # \u53f3\u8f6c90\u5ea6<\/p>\n<h2><strong>\u7ed3\u675fTurtle\u7ed8\u56fe<\/strong><\/h2>\n<p>turtle.done()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4f60\u770b\u5230\u4e00\u4e2a\u7a97\u53e3\u5f39\u51fa\u5e76\u7ed8\u5236\u4e86\u4e00\u4e2a\u56db\u8fb9\u5f62\uff0c\u8bf4\u660eTurtle\u5e93\u5df2\u7ecf\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u914d\u7f6e\u548c\u4f7f\u7528Turtle\u5e93<\/h3>\n<\/p>\n<p><p>\u5728\u6210\u529f\u5b89\u88c5\u548c\u9a8c\u8bc1Turtle\u5e93\u540e\uff0c\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u914d\u7f6e\u548c\u4f7f\u7528\u3002Turtle\u5e93\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7ed8\u56fe\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5728\u5b66\u4e60\u7f16\u7a0b\u7684\u8fc7\u7a0b\u4e2d\u66f4\u597d\u5730\u7406\u89e3\u56fe\u5f62\u548c\u52a8\u753b\u7684\u6982\u5ff5\u3002<\/p>\n<\/p>\n<p><h4>1. Turtle\u5e93\u7684\u57fa\u672c\u4f7f\u7528<\/h4>\n<\/p>\n<p><p>Turtle\u5e93\u63d0\u4f9b\u4e86\u7b80\u5355\u6613\u7528\u7684API\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u5feb\u901f\u521b\u5efa\u590d\u6742\u7684\u56fe\u5f62\u548c\u52a8\u753b\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u547d\u4ee4\u7684\u4ecb\u7ecd\uff1a<\/p>\n<\/p>\n<ul>\n<li><code>turtle.forward(distance)<\/code>: \u5411\u524d\u79fb\u52a8\u6307\u5b9a\u7684\u8ddd\u79bb\u3002<\/li>\n<li><code>turtle.backward(distance)<\/code>: \u5411\u540e\u79fb\u52a8\u6307\u5b9a\u7684\u8ddd\u79bb\u3002<\/li>\n<li><code>turtle.right(angle)<\/code>: \u987a\u65f6\u9488\u65cb\u8f6c\u6307\u5b9a\u7684\u89d2\u5ea6\u3002<\/li>\n<li><code>turtle.left(angle)<\/code>: \u9006\u65f6\u9488\u65cb\u8f6c\u6307\u5b9a\u7684\u89d2\u5ea6\u3002<\/li>\n<li><code>turtle.penup()<\/code>: \u63d0\u8d77\u753b\u7b14\uff0c\u79fb\u52a8\u65f6\u4e0d\u4f1a\u7ed8\u5236\u3002<\/li>\n<li><code>turtle.pendown()<\/code>: \u653e\u4e0b\u753b\u7b14\uff0c\u79fb\u52a8\u65f6\u4f1a\u7ed8\u5236\u3002<\/li>\n<li><code>turtle.goto(x, y)<\/code>: \u79fb\u52a8\u5230\u6307\u5b9a\u7684\u5750\u6807\u4f4d\u7f6e\u3002<\/li>\n<li><code>turtle.circle(radius)<\/code>: \u7ed8\u5236\u4e00\u4e2a\u6307\u5b9a\u534a\u5f84\u7684\u5706\u3002<\/li>\n<\/ul>\n<p><h4>2. \u81ea\u5b9a\u4e49Turtle\u7684\u5916\u89c2<\/h4>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6eTurtle\u7684\u989c\u8272\u3001\u5f62\u72b6\u548c\u901f\u5ea6\u6765\u81ea\u5b9a\u4e49\u5b83\u7684\u5916\u89c2\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">turtle.color(&quot;blue&quot;)  # \u8bbe\u7f6e\u753b\u7b14\u989c\u8272\u4e3a\u84dd\u8272<\/p>\n<p>turtle.shape(&quot;turtle&quot;)  # \u8bbe\u7f6eTurtle\u7684\u5f62\u72b6\u4e3a\u4e4c\u9f9f<\/p>\n<p>turtle.speed(2)  # \u8bbe\u7f6e\u7ed8\u56fe\u901f\u5ea6<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Turtle\u5e93\u4e3a\u521d\u5b66\u8005\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6709\u8da3\u7684\u5b66\u4e60\u5e73\u53f0\uff0c\u901a\u8fc7\u52a8\u624b\u7ed8\u5236\u56fe\u5f62\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u7406\u89e3\u7f16\u7a0b\u4e2d\u7684\u5faa\u73af\u3001\u6761\u4ef6\u5224\u65ad\u7b49\u57fa\u672c\u6982\u5ff5\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/h3>\n<\/p>\n<p><p>\u5728\u5b89\u88c5\u548c\u4f7f\u7528Turtle\u5e93\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u5931\u8d25\u6216\u627e\u4e0d\u5230Turtle\u5e93<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u68c0\u67e5\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u4f60\u7684Python\u7248\u672c\u662f3.x\u3002<\/li>\n<li>\u786e\u4fddpip\u5df2\u7ecf\u5b89\u88c5\u5e76\u4e14\u662f\u6700\u65b0\u7248\u672c\u3002<\/li>\n<li>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\u662f\u5426\u6b63\u5e38\uff0c\u56e0\u4e3apip\u9700\u8981\u901a\u8fc7\u7f51\u7edc\u4e0b\u8f7d\u5e93\u3002<\/li>\n<\/ul>\n<p><h4>2. Turtle\u7a0b\u5e8f\u65e0\u6cd5\u8fd0\u884c<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u8fd0\u884cTurtle\u7a0b\u5e8f\u65f6\u51fa\u73b0\u9519\u8bef\uff0c\u53ef\u4ee5\u68c0\u67e5\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u5df2\u7ecf\u6b63\u786e\u5bfc\u5165Turtle\u5e93\u3002<\/li>\n<li>\u68c0\u67e5\u4ee3\u7801\u662f\u5426\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\u3002<\/li>\n<li>\u786e\u4fdd\u6ca1\u6709\u5176\u4ed6\u7a0b\u5e8f\u5360\u7528\u4e86Turtle\u7684\u7ed8\u56fe\u7a97\u53e3\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\u548c\u89e3\u51b3\u65b9\u6848\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u6210\u529f\u5b89\u88c5\u548c\u4f7f\u7528Turtle\u5e93\uff0c\u4ece\u800c\u5f00\u59cb\u4f60\u7684Python\u7f16\u7a0b\u4e4b\u65c5\u3002Turtle\u5e93\u662f\u4e00\u4e2a\u5b66\u4e60\u7f16\u7a0b\u7684\u7edd\u4f73\u5de5\u5177\uff0c\u5e0c\u671b\u4f60\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u80fd\u591f\u4eab\u53d7\u4e50\u8da3\u5e76\u6709\u6240\u6536\u83b7\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u68c0\u67e5turtle\u6a21\u5757\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5728Python\u547d\u4ee4\u884c\u6216\u811a\u672c\u4e2d\u5c1d\u8bd5\u5bfc\u5165turtle\u6a21\u5757\u6765\u786e\u8ba4\u5b83\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u3002\u53ea\u9700\u8f93\u5165<code>import turtle<\/code>\uff0c\u5982\u679c\u6ca1\u6709\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660e\u6a21\u5757\u5df2\u7ecf\u6210\u529f\u5b89\u88c5\u3002\u5982\u679c\u51fa\u73b0\u9519\u8bef\u6d88\u606f\uff0c\u5219\u9700\u8981\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5b89\u88c5turtle\u6a21\u5757\u9700\u8981\u54ea\u4e9bPython\u7248\u672c\uff1f<\/strong><br \/>turtle\u6a21\u5757\u662fPython\u7684\u6807\u51c6\u5e93\u4e4b\u4e00\uff0c\u901a\u5e38\u5728Python\u7684\u6240\u6709\u7248\u672c\u4e2d\u90fd\u5df2\u7ecf\u5305\u542b\u3002\u56e0\u6b64\uff0c\u7528\u6237\u53ea\u9700\u786e\u4fdd\u5b89\u88c5\u7684\u662fPython 3.x\u7248\u672c\uff0c\u4fbf\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528turtle\u6a21\u5757\uff0c\u65e0\u9700\u5355\u72ec\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5728Windows\u548cMac\u4e0a\u5b89\u88c5turtle\u6709\u4f55\u4e0d\u540c\uff1f<\/strong><br \/>\u5728Windows\u548cMac\u4e0a\uff0cturtle\u6a21\u5757\u7684\u4f7f\u7528\u65b9\u5f0f\u57fa\u672c\u76f8\u540c\uff0c\u56e0\u4e3a\u5b83\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\u3002\u7528\u6237\u53ea\u9700\u786e\u4fddPython\u73af\u5883\u5df2\u6b63\u786e\u5b89\u88c5\u3002\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7Python\u7684\u5b89\u88c5\u7a0b\u5e8f\u8fdb\u884c\u5b89\u88c5\uff0c\u800c\u5728Mac\u4e0a\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Homebrew\u6216\u76f4\u63a5\u4ece\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\u8fdb\u884c\u8bbe\u7f6e\u3002\u65e0\u8bba\u54ea\u4e2a\u7cfb\u7edf\uff0c\u5b8c\u6210\u5b89\u88c5\u540e\u90fd\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528turtle\u6a21\u5757\u3002<\/p>\n<p><strong>\u5728\u4f7f\u7528turtle\u65f6\uff0c\u5982\u4f55\u89e3\u51b3\u5e38\u89c1\u7684\u9519\u8bef\uff1f<\/strong><br \/>\u5728\u4f7f\u7528turtle\u6a21\u5757\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u5982\u679c\u56fe\u5f62\u7a97\u53e3\u65e0\u6cd5\u663e\u793a\uff0c\u53ef\u4ee5\u68c0\u67e5\u662f\u5426\u5728\u5408\u9002\u7684\u73af\u5883\u4e2d\u8fd0\u884c\u4ee3\u7801\uff08\u5982IDLE\u6216Jupyter Notebook\uff09\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u5728\u4f7f\u7528turtle\u7ed8\u56fe\u65f6\u8c03\u7528<code>turtle.done()<\/code>\uff0c\u4ee5\u4fbf\u6b63\u786e\u7ed3\u675f\u7ed8\u56fe\u5e76\u663e\u793a\u56fe\u5f62\u3002\u5982\u9047\u5176\u4ed6\u95ee\u9898\uff0c\u53ef\u4ee5\u53c2\u8003Python\u7684\u5b98\u65b9\u6587\u6863\u6216\u793e\u533a\u8bba\u575b\u5bfb\u6c42\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u5b89\u88c5Turtle\u5e93\uff0c\u4f60\u9700\u8981\u786e\u4fdd\u4f60\u7684Python\u73af\u5883\u5df2\u7ecf\u914d\u7f6e\u597d\uff0c\u5b89\u88c5Turtle\u5e93\u7684\u6b65\u9aa4\u4e3b\u8981\u5305 [&hellip;]","protected":false},"author":3,"featured_media":936431,"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\/936427"}],"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=936427"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/936427\/revisions"}],"predecessor-version":[{"id":936432,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/936427\/revisions\/936432"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/936431"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=936427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=936427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=936427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}