{"id":1169790,"date":"2025-01-15T16:14:50","date_gmt":"2025-01-15T08:14:50","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1169790.html"},"modified":"2025-01-15T16:14:53","modified_gmt":"2025-01-15T08:14:53","slug":"%e5%a6%82%e4%bd%95%e8%bf%90%e8%a1%8cpython%e7%bb%98%e5%9b%be%e5%ba%93turtle","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1169790.html","title":{"rendered":"\u5982\u4f55\u8fd0\u884cpython\u7ed8\u56fe\u5e93turtle"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26070633\/293f7ce3-b76d-4492-8914-042ae7b92b60.webp\" alt=\"\u5982\u4f55\u8fd0\u884cpython\u7ed8\u56fe\u5e93turtle\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u8fd0\u884cPython\u7ed8\u56fe\u5e93Turtle<\/strong><\/p>\n<\/p>\n<p><p>\u8981\u8fd0\u884cPython\u7ed8\u56fe\u5e93Turtle\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5Python\u53ca\u5176\u76f8\u5173\u7684\u5e93\u3002<strong>\u5b89\u88c5Python\u3001\u5b89\u88c5Turtle\u5e93\u3001\u7f16\u5199Turtle\u7ed8\u56fe\u4ee3\u7801\u3001\u8fd0\u884c\u4ee3\u7801<\/strong>\u662f\u8fd0\u884cTurtle\u7684\u51e0\u4e2a\u4e3b\u8981\u6b65\u9aa4\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u6267\u884c\u8fd9\u4e9b\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u8be6\u7ec6\u63cf\u8ff0\u5176\u4e2d\u7684\u4e00\u70b9\uff1a<strong>\u5b89\u88c5Python<\/strong>\u3002\u5728\u5b89\u88c5Python\u4e4b\u524d\uff0c\u9700\u8981\u68c0\u67e5\u7cfb\u7edf\u662f\u5426\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u786e\u8ba4\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5Python\uff0c\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85%E9%80%82%E5%90%88%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%E7%89%88%E6%9C%AC%E3%80%82%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E7%AE%80%E5%8D%95%EF%BC%8C%E6%A0%B9%E6%8D%AE%E6%8F%90%E7%A4%BA%E8%BF%9B%E8%A1%8C%E6%93%8D%E4%BD%9C%E5%8D%B3%E5%8F%AF%E3%80%82%E5%AE%89%E8%A3%85%E5%AE%8C%E6%88%90%E5%90%8E%EF%BC%8C%E5%86%8D%E6%AC%A1%E9%80%9A%E8%BF%87%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%A1%AE%E8%AE%A4Python%E6%98%AF%E5%90%A6%E5%AE%89%E8%A3%85%E6%88%90%E5%8A%9F%E3%80%82\">https:\/\/www.python.org\/\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5\u9002\u5408\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002\u5b89\u88c5\u8fc7\u7a0b\u7b80\u5355\uff0c\u6839\u636e\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u5373\u53ef\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u518d\u6b21\u901a\u8fc7\u547d\u4ee4\u884c\u786e\u8ba4Python\u662f\u5426\u5b89\u88c5\u6210\u529f\u3002<\/a><\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u5b89\u88c5Python<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5\u662f\u5426\u5df2\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a\n<pre><code>python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u6216<\/p>\n<pre><code>python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5982\u679c\u5df2\u7ecf\u5b89\u88c5\uff0c\u4f1a\u663e\u793aPython\u7684\u7248\u672c\u53f7\u3002\u5982\u679c\u672a\u5b89\u88c5\uff0c\u5219\u9700\u8981\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7d\u5e76\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff1a<a href=\"https:\/\/www.python.org\/\">https:\/\/www.python.org\/<\/a><\/li>\n<li>\u5728\u4e0b\u8f7d\u9875\u9762\u9009\u62e9\u9002\u5408\u64cd\u4f5c\u7cfb\u7edf\u7684Python\u7248\u672c\u3002<\/li>\n<li>\u4e0b\u8f7d\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f\uff0c\u6839\u636e\u63d0\u793a\u8fdb\u884c\u5b89\u88c5\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u9009\u62e9\u6dfb\u52a0Python\u5230\u7cfb\u7edf\u8def\u5f84\uff08Add Python to PATH\uff09\uff0c\u8fd9\u5c06\u6709\u52a9\u4e8e\u5728\u547d\u4ee4\u884c\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u518d\u6b21\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u786e\u8ba4\u5b89\u88c5\uff1a\n<pre><code>python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u6216<\/p>\n<pre><code>python3 --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u4f1a\u663e\u793a\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\u53f7\uff0c\u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u5b89\u88c5Turtle\u5e93<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5Turtle\u5e93\u662f\u5426\u5df2\u5b89\u88c5<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u5b89\u88c5Python\u7684\u8fc7\u7a0b\u4e2d\uff0c\u67d0\u4e9b\u7248\u672c\u7684Python\u81ea\u5e26\u4e86Turtle\u5e93\u3002\u53ef\u4ee5\u901a\u8fc7\u5728Python\u4ea4\u4e92\u5f0f\u73af\u5883\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5\uff1a\n<pre><code class=\"language-python\">import turtle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5982\u679c\u6ca1\u6709\u62a5\u9519\uff0c\u5219\u8868\u793aTurtle\u5e93\u5df2\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Turtle\u5e93<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679c\u6ca1\u6709\u5b89\u88c5Turtle\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u8fdb\u884c\u5b89\u88c5\u3002\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a\n<pre><code>pip install PythonTurtle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u7f16\u5199Turtle\u7ed8\u56fe\u4ee3\u7801<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaPython\u811a\u672c\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982VS Code\u3001PyCharm\u3001Sublime Text\u7b49\uff09\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u811a\u672c\u6587\u4ef6\uff0c\u4f8b\u5982<code>turtle_example.py<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199Turtle\u7ed8\u56fe\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u811a\u672c\u6587\u4ef6\u4e2d\u7f16\u5199Turtle\u7ed8\u56fe\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u4e00\u4e2a\u7b80\u5355\u7684\u6b63\u65b9\u5f62\uff1a\n<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\u6b63\u65b9\u5f62<\/strong><\/h2>\n<p>for _ in range(4):<\/p>\n<p>    t.forward(100)  # \u5411\u524d\u79fb\u52a8100\u50cf\u7d20<\/p>\n<p>    t.right(90)  # \u5411\u53f3\u8f6c90\u5ea6<\/p>\n<h2><strong>\u5b8c\u6210\u7ed8\u56fe<\/strong><\/h2>\n<p>turtle.done()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u8fd0\u884c\u4ee3\u7801<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8fd0\u884cPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4fdd\u5b58\u4ee3\u7801\u540e\uff0c\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230\u811a\u672c\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u811a\u672c\uff1a\n<pre><code>python turtle_example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u6216<\/p>\n<pre><code>python3 turtle_example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>Turtle\u7a97\u53e3\u5c06\u6253\u5f00\u5e76\u7ed8\u5236\u4e00\u4e2a\u6b63\u65b9\u5f62\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8c03\u8bd5\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679c\u4ee3\u7801\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u9519\u8bef\uff0c\u53ef\u4ee5\u68c0\u67e5\u4ee3\u7801\u8bed\u6cd5\u6216\u5b89\u88c5\u4f9d\u8d56\u5e93\u662f\u5426\u6b63\u786e\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001Turtle\u5e93\u7684\u57fa\u672c\u64cd\u4f5c<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaTurtle\u5bf9\u8c61<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>turtle.Turtle()<\/code>\u521b\u5efa\u4e00\u4e2aTurtle\u5bf9\u8c61\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-python\">t = turtle.Turtle()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u79fb\u52a8Turtle<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.forward(distance)<\/code>\uff1a\u5411\u524d\u79fb\u52a8\u6307\u5b9a\u8ddd\u79bb\u3002<\/li>\n<li><code>t.backward(distance)<\/code>\uff1a\u5411\u540e\u79fb\u52a8\u6307\u5b9a\u8ddd\u79bb\u3002<\/li>\n<li><code>t.right(angle)<\/code>\uff1a\u5411\u53f3\u8f6c\u6307\u5b9a\u89d2\u5ea6\u3002<\/li>\n<li><code>t.left(angle)<\/code>\uff1a\u5411\u5de6\u8f6c\u6307\u5b9a\u89d2\u5ea6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed8\u5236\u5f62\u72b6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u5faa\u73af\u548c\u79fb\u52a8\u547d\u4ee4\u53ef\u4ee5\u7ed8\u5236\u5404\u79cd\u5f62\u72b6\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u4e00\u4e2a\u4e09\u89d2\u5f62\uff1a\n<pre><code class=\"language-python\">for _ in range(3):<\/p>\n<p>    t.forward(100)<\/p>\n<p>    t.right(120)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u989c\u8272<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.color(color)<\/code>\uff1a\u8bbe\u7f6eTurtle\u7684\u989c\u8272\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-python\">t.color(&quot;red&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li><code>t.begin_fill()<\/code>\u548c<code>t.end_fill()<\/code>\uff1a\u586b\u5145\u989c\u8272\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-python\">t.begin_fill()<\/p>\n<p>for _ in range(4):<\/p>\n<p>    t.forward(100)<\/p>\n<p>    t.right(90)<\/p>\n<p>t.end_fill()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u63a7\u5236\u901f\u5ea6<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.speed(speed)<\/code>\uff1a\u8bbe\u7f6eTurtle\u7684\u7ed8\u56fe\u901f\u5ea6\uff0c\u8303\u56f4\u4ece0\uff08\u6700\u5feb\uff09\u523010\uff08\u6162\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001Turtle\u5e93\u7684\u9ad8\u7ea7\u64cd\u4f5c<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbe\u7f6e\u753b\u5e03<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>turtle.setup(width, height)<\/code>\uff1a\u8bbe\u7f6e\u753b\u5e03\u5927\u5c0f\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-python\">turtle.setup(800, 600)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u9690\u85cf\u548c\u663e\u793aTurtle<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.hideturtle()<\/code>\uff1a\u9690\u85cfTurtle\u3002<\/li>\n<li><code>t.showturtle()<\/code>\uff1a\u663e\u793aTurtle\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7b14\u7684\u63a7\u5236<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.penup()<\/code>\uff1a\u62ac\u8d77\u7b14\uff0c\u4e0d\u7ed8\u5236\u3002<\/li>\n<li><code>t.pendown()<\/code>\uff1a\u653e\u4e0b\u7b14\uff0c\u5f00\u59cb\u7ed8\u5236\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed8\u5236\u6587\u5b57<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.write(text, font=(&quot;font_name&quot;, size, &quot;type&quot;))<\/code>\uff1a\u5728\u753b\u5e03\u4e0a\u7ed8\u5236\u6587\u5b57\uff0c\u4f8b\u5982\uff1a\n<pre><code class=\"language-python\">t.write(&quot;Hello, Turtle!&quot;, font=(&quot;Arial&quot;, 16, &quot;normal&quot;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6e05\u9664\u753b\u5e03<\/strong><\/p>\n<\/p>\n<ul>\n<li><code>t.clear()<\/code>\uff1a\u6e05\u9664\u5f53\u524dTurtle\u7684\u7ed8\u56fe\u3002<\/li>\n<li><code>t.reset()<\/code>\uff1a\u91cd\u7f6eTurtle\u72b6\u6001\u548c\u6e05\u9664\u7ed8\u56fe\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e03\u3001Turtle\u5e93\u7684\u5e94\u7528\u5b9e\u4f8b<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7ed8\u5236\u591a\u8fb9\u5f62<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u5faa\u73af\u548c\u89d2\u5ea6\u8ba1\u7b97\u7ed8\u5236\u591a\u8fb9\u5f62\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u4e00\u4e2a\u4e94\u8fb9\u5f62\uff1a\n<pre><code class=\"language-python\">sides = 5<\/p>\n<p>angle = 360 \/ sides<\/p>\n<p>for _ in range(sides):<\/p>\n<p>    t.forward(100)<\/p>\n<p>    t.right(angle)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed8\u5236\u661f\u5f62<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u8c03\u6574\u8f6c\u89d2\u7ed8\u5236\u661f\u5f62\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u4e00\u4e2a\u4e94\u89d2\u661f\uff1a\n<pre><code class=\"language-python\">for _ in range(5):<\/p>\n<p>    t.forward(100)<\/p>\n<p>    t.right(144)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed8\u5236\u540c\u5fc3\u5706<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528\u5faa\u73af\u7ed8\u5236\u591a\u4e2a\u540c\u5fc3\u5706\uff1a\n<pre><code class=\"language-python\">for radius in range(50, 201, 50):<\/p>\n<p>    t.penup()<\/p>\n<p>    t.goto(0, -radius)<\/p>\n<p>    t.pendown()<\/p>\n<p>    t.circle(radius)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u516b\u3001Turtle\u5e93\u7684\u4e92\u52a8\u529f\u80fd<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u54cd\u5e94\u952e\u76d8\u4e8b\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u53ef\u4ee5\u4f7f\u7528<code>turtle.listen()<\/code>\u548c<code>turtle.onkey()<\/code>\u51fd\u6570\u54cd\u5e94\u952e\u76d8\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c\u6309\u4e0b\u7bad\u5934\u952e\u79fb\u52a8Turtle\uff1a\n<pre><code class=\"language-python\">def move_forward():<\/p>\n<p>    t.forward(30)<\/p>\n<p>def move_backward():<\/p>\n<p>    t.backward(30)<\/p>\n<p>def turn_left():<\/p>\n<p>    t.left(30)<\/p>\n<p>def turn_right():<\/p>\n<p>    t.right(30)<\/p>\n<p>turtle.listen()<\/p>\n<p>turtle.onkey(move_forward, &quot;Up&quot;)<\/p>\n<p>turtle.onkey(move_backward, &quot;Down&quot;)<\/p>\n<p>turtle.onkey(turn_left, &quot;Left&quot;)<\/p>\n<p>turtle.onkey(turn_right, &quot;Right&quot;)<\/p>\n<p>turtle.m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>nloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u54cd\u5e94\u9f20\u6807\u4e8b\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u53ef\u4ee5\u4f7f\u7528<code>turtle.onscreenclick()<\/code>\u51fd\u6570\u54cd\u5e94\u9f20\u6807\u70b9\u51fb\u4e8b\u4ef6\u3002\u4f8b\u5982\uff0c\u70b9\u51fb\u753b\u5e03\u79fb\u52a8Turtle\u5230\u70b9\u51fb\u4f4d\u7f6e\uff1a\n<pre><code class=\"language-python\">def move_to_click(x, y):<\/p>\n<p>    t.goto(x, y)<\/p>\n<p>turtle.onscreenclick(move_to_click)<\/p>\n<p>turtle.mainloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e5d\u3001Turtle\u5e93\u7684\u52a8\u753b\u6548\u679c<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbe\u7f6e\u52a8\u753b\u5ef6\u8fdf<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>turtle.delay()<\/code>\u51fd\u6570\u8bbe\u7f6e\u52a8\u753b\u5ef6\u8fdf\u3002\u4f8b\u5982\uff0c\u8bbe\u7f6e\u5ef6\u8fdf\u4e3a100\u6beb\u79d2\uff1a\n<pre><code class=\"language-python\">turtle.delay(100)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u521b\u5efa\u7b80\u5355\u52a8\u753b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u5faa\u73af\u548c\u65f6\u95f4\u63a7\u5236\u521b\u5efa\u52a8\u753b\u6548\u679c\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u4e00\u4e2a\u65cb\u8f6c\u7684\u6b63\u65b9\u5f62\uff1a\n<pre><code class=\"language-python\">import time<\/p>\n<p>t.speed(0)<\/p>\n<p>while True:<\/p>\n<p>    t.forward(100)<\/p>\n<p>    t.right(90)<\/p>\n<p>    time.sleep(0.1)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u5341\u3001Turtle\u5e93\u7684\u6269\u5c55\u5e94\u7528<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7ed8\u5236\u590d\u6742\u56fe\u5f62<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u7ec4\u5408\u57fa\u672c\u56fe\u5f62\u548c\u9ad8\u7ea7\u7ed8\u56fe\u6280\u672f\uff0c\u53ef\u4ee5\u7ed8\u5236\u590d\u6742\u7684\u56fe\u5f62\u3002\u4f8b\u5982\uff0c\u7ed8\u5236\u5206\u5f62\u56fe\u6848\uff1a\n<pre><code class=\"language-python\">def draw_fractal(length, depth):<\/p>\n<p>    if depth == 0:<\/p>\n<p>        t.forward(length)<\/p>\n<p>        return<\/p>\n<p>    length \/= 3.0<\/p>\n<p>    draw_fractal(length, depth-1)<\/p>\n<p>    t.left(60)<\/p>\n<p>    draw_fractal(length, depth-1)<\/p>\n<p>    t.right(120)<\/p>\n<p>    draw_fractal(length, depth-1)<\/p>\n<p>    t.left(60)<\/p>\n<p>    draw_fractal(length, depth-1)<\/p>\n<p>t.speed(0)<\/p>\n<p>t.penup()<\/p>\n<p>t.goto(-200, 0)<\/p>\n<p>t.pendown()<\/p>\n<p>draw_fractal(400, 4)<\/p>\n<p>turtle.done()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed3\u5408\u5176\u4ed6\u5e93<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u7ed3\u5408\u5176\u4ed6Python\u5e93\uff08\u5982Pandas\u3001Matplotlib\u7b49\uff09\u8fdb\u884c\u6570\u636e\u53ef\u89c6\u5316\u3002\u4f8b\u5982\uff0c\u4f7f\u7528Turtle\u5e93\u7ed8\u5236\u6570\u636e\u56fe\u8868\uff1a\n<pre><code class=\"language-python\">import pandas as pd<\/p>\n<p>data = pd.read_csv(&quot;data.csv&quot;)<\/p>\n<p>t.speed(0)<\/p>\n<p>for index, row in data.iterrows():<\/p>\n<p>    t.goto(row[&quot;x&quot;], row[&quot;y&quot;])<\/p>\n<p>    t.dot(5)<\/p>\n<p>turtle.done()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u5341\u4e00\u3001Turtle\u5e93\u7684\u5b66\u4e60\u8d44\u6e90<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u5b98\u65b9\u6587\u6863<\/strong><\/p>\n<\/p>\n<ul>\n<li>Python Turtle\u5e93\u7684\u5b98\u65b9\u6587\u6863\u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u51fd\u6570\u8bf4\u660e\u548c\u793a\u4f8b\u4ee3\u7801\uff1a<a href=\"https:\/\/docs.python.org\/3\/library\/turtle.html\">https:\/\/docs.python.org\/3\/library\/turtle.html<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5728\u7ebf\u6559\u7a0b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u8bb8\u591a\u5728\u7ebf\u6559\u7a0b\u548c\u8bfe\u7a0b\u53ef\u4ee5\u5e2e\u52a9\u521d\u5b66\u8005\u5feb\u901f\u638c\u63e1Turtle\u5e93\u7684\u4f7f\u7528\u3002\u4f8b\u5982\uff0cYouTube\u4e0a\u6709\u8bb8\u591a\u5173\u4e8eTurtle\u7ed8\u56fe\u7684\u6559\u5b66\u89c6\u9891\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4e66\u7c4d\u63a8\u8350<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u300aPython Programming for the Absolute Beginner\u300b\u662f\u4e00\u672c\u9002\u5408\u521d\u5b66\u8005\u7684\u4e66\u7c4d\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u8bb8\u591a\u5173\u4e8eTurtle\u7ed8\u56fe\u7684\u793a\u4f8b\u548c\u7ec3\u4e60\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u5341\u4e8c\u3001Turtle\u5e93\u7684\u5b9e\u8df5\u9879\u76ee<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>\u7ed8\u5236\u65f6\u949f<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528Turtle\u5e93\u7ed8\u5236\u4e00\u4e2a\u6a21\u62df\u65f6\u949f\uff0c\u5305\u62ec\u65f6\u9488\u3001\u5206\u9488\u548c\u79d2\u9488\uff1a\n<pre><code class=\"language-python\">import datetime<\/p>\n<p>def draw_hand(length, angle):<\/p>\n<p>    t.penup()<\/p>\n<p>    t.goto(0, 0)<\/p>\n<p>    t.setheading(angle)<\/p>\n<p>    t.pendown()<\/p>\n<p>    t.forward(length)<\/p>\n<p>    t.penup()<\/p>\n<p>    t.backward(length)<\/p>\n<p>    t.pendown()<\/p>\n<p>def draw_clock():<\/p>\n<p>    t.speed(0)<\/p>\n<p>    t.penup()<\/p>\n<p>    t.goto(0, -200)<\/p>\n<p>    t.pendown()<\/p>\n<p>    t.circle(200)<\/p>\n<p>    for i in range(12):<\/p>\n<p>        t.penup()<\/p>\n<p>        t.goto(0, 0)<\/p>\n<p>        t.setheading(-30 * i + 60)<\/p>\n<p>        t.forward(180)<\/p>\n<p>        t.pendown()<\/p>\n<p>        t.forward(20)<\/p>\n<p>def update_clock():<\/p>\n<p>    now = datetime.datetime.now()<\/p>\n<p>    second_angle = -6 * now.second + 90<\/p>\n<p>    minute_angle = -6 * now.minute + 90<\/p>\n<p>    hour_angle = -30 * (now.hour % 12) + 90<\/p>\n<p>    t.clear()<\/p>\n<p>    draw_clock()<\/p>\n<p>    t.color(&quot;red&quot;)<\/p>\n<p>    draw_hand(150, second_angle)<\/p>\n<p>    t.color(&quot;blue&quot;)<\/p>\n<p>    draw_hand(120, minute_angle)<\/p>\n<p>    t.color(&quot;green&quot;)<\/p>\n<p>    draw_hand(90, hour_angle)<\/p>\n<p>    t.color(&quot;black&quot;)<\/p>\n<p>    turtle.ontimer(update_clock, 1000)<\/p>\n<p>draw_clock()<\/p>\n<p>update_clock()<\/p>\n<p>turtle.mainloop()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed8\u5236\u8ff7\u5bab<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528Turtle\u5e93\u7ed8\u5236\u4e00\u4e2a\u7b80\u5355\u7684\u8ff7\u5bab\uff0c\u5e76\u5b9e\u73b0Turtle\u7684\u81ea\u52a8\u6c42\u89e3\uff1a\n<pre><code class=\"language-python\">maze = [<\/p>\n<p>    [1, 1, 1, 1, 1, 1, 1, 1],<\/p>\n<p>    [1, 0, 0, 0, 1, 0, 0, 1],<\/p>\n<p>    [1, 0, 1, 0, 1, 0, 1, 1],<\/p>\n<p>    [1, 0, 1, 0, 0, 0, 0, 1],<\/p>\n<p>    [1, 1, 1, 1, 1, 1, 1, 1]<\/p>\n<p>]<\/p>\n<p>def draw_maze():<\/p>\n<p>    t.speed(0)<\/p>\n<p>    t.penup()<\/p>\n<p>    for y in range(len(maze)):<\/p>\n<p>        for x in range(len(maze[y])):<\/p>\n<p>            if maze[y][x] == 1:<\/p>\n<p>                t.goto(x * 20 - 80, 80 - y * 20)<\/p>\n<p>                t.pendown()<\/p>\n<p>                t.begin_fill()<\/p>\n<p>                for _ in range(4):<\/p>\n<p>                    t.forward(20)<\/p>\n<p>                    t.right(90)<\/p>\n<p>                t.end_fill()<\/p>\n<p>                t.penup()<\/p>\n<p>def solve_maze(x, y):<\/p>\n<p>    if x == len(maze[0]) - 1 and y == len(maze) - 1:<\/p>\n<p>        return True<\/p>\n<p>    if maze[y][x] == 1 or maze[y][x] == 2:<\/p>\n<p>        return False<\/p>\n<p>    maze[y][x] = 2<\/p>\n<p>    t.goto(x * 20 - 80, 80 - y * 20)<\/p>\n<p>    if solve_maze(x + 1, y) or solve_maze(x, y + 1) or solve_maze(x - 1, y) or solve_maze(x, y - 1):<\/p>\n<p>        return True<\/p>\n<p>    maze[y][x] = 0<\/p>\n<p>    return False<\/p>\n<p>draw_maze()<\/p>\n<p>t.goto(-80, 80)<\/p>\n<p>solve_maze(1, 1)<\/p>\n<p>turtle.done()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u5341\u4e09\u3001\u5e38\u89c1\u95ee\u9898\u53ca\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<\/p>\n<ol>\n<li>\n<p><strong>Turtle\u7a97\u53e3\u4e0d\u663e\u793a<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u4ee3\u7801\u4e2d\u5305\u542b<code>turtle.done()<\/code>\u6216<code>turtle.mainloop()<\/code>\uff0c\u4ee5\u4fdd\u6301\u7a97\u53e3\u6253\u5f00\u72b6\u6001\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7ed8\u56fe\u901f\u5ea6\u8fc7\u6162<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>t.speed(0)<\/code>\u8bbe\u7f6eTurtle\u7684\u7ed8\u56fe\u901f\u5ea6\u4e3a\u6700\u5feb\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u4f9d\u8d56\u5e93\u5931\u8d25<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u5df2\u5b89\u88c5pip\uff0c\u5e76\u4f7f\u7528\u7ba1\u7406\u5458\u6743\u9650\u8fd0\u884c\u5b89\u88c5\u547d\u4ee4\u3002\u5982\u679c\u4ecd\u7136\u5931\u8d25\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u624b\u52a8\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u8fd0\u884c\u62a5\u9519<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u68c0\u67e5\u4ee3\u7801\u8bed\u6cd5\u662f\u5426\u6b63\u786e\uff0c\u786e\u4fdd\u6240\u6709\u5e93\u5df2\u6b63\u786e\u5bfc\u5165\u3002\u5982\u679c\u4ecd\u7136\u62a5\u9519\uff0c\u53ef\u4ee5\u53c2\u8003\u5b98\u65b9\u6587\u6863\u6216\u5728\u7ebf\u793e\u533a\u5bfb\u6c42\u5e2e\u52a9\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u5341\u56db\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u60a8\u5df2\u7ecf\u4e86\u89e3\u4e86\u5982\u4f55\u8fd0\u884cPython\u7ed8\u56fe\u5e93Turtle\uff0c\u5e76\u638c\u63e1\u4e86\u57fa\u672c\u7684\u7ed8\u56fe\u64cd\u4f5c\u548c\u9ad8\u7ea7\u5e94\u7528\u3002Turtle\u5e93\u662f\u4e00\u4e2a\u975e\u5e38\u9002\u5408\u521d\u5b66\u8005\u5b66\u4e60\u7f16\u7a0b\u548c\u7ed8\u56fe\u7684\u5de5\u5177\uff0c\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u7ed8\u56fe\u529f\u80fd\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199\u4ee3\u7801\u5b9e\u73b0\u52a8\u753b\u548c\u4e92\u52a8\u6548\u679c\u3002\u5e0c\u671b\u672c\u6587\u80fd\u591f\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u548c\u4f7f\u7528Turtle\u5e93\uff0c\u6fc0\u53d1\u60a8\u7684\u521b\u9020\u529b\u548c\u7f16\u7a0b\u5174\u8da3\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5b89\u88c5Python\u548cturtle\u5e93\u4ee5\u5f00\u59cb\u7ed8\u56fe\uff1f<\/strong><br \/>\u8981\u8fd0\u884cturtle\u5e93\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5Python\u3002\u53ef\u4ee5\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684Python\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0cturtle\u5e93\u901a\u5e38\u5df2\u7ecf\u5305\u542b\u5728\u6807\u51c6\u5e93\u4e2d\uff0c\u60a8\u65e0\u9700\u5355\u72ec\u5b89\u88c5\u3002\u53ea\u9700\u6253\u5f00Python\u7684IDLE\u6216\u4efb\u4f55\u652f\u6301Python\u7684IDE\uff0c\u4fbf\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165turtle\u5e93\u8fdb\u884c\u7ed8\u56fe\u3002<\/p>\n<p><strong>turtle\u5e93\u7684\u57fa\u672c\u7ed8\u56fe\u547d\u4ee4\u6709\u54ea\u4e9b\uff1f<\/strong><br \/>turtle\u5e93\u63d0\u4f9b\u4e86\u8bb8\u591a\u7b80\u5355\u6613\u7528\u7684\u547d\u4ee4\u6765\u521b\u5efa\u56fe\u5f62\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>turtle.forward(100)<\/code>\u53ef\u4ee5\u5411\u524d\u79fb\u52a8\u6d77\u9f9f100\u5355\u4f4d\uff0c<code>turtle.right(90)<\/code>\u53ef\u4ee5\u8ba9\u6d77\u9f9f\u987a\u65f6\u9488\u65cb\u8f6c90\u5ea6\u3002\u901a\u8fc7\u7ec4\u5408\u8fd9\u4e9b\u547d\u4ee4\uff0c\u60a8\u53ef\u4ee5\u7ed8\u5236\u5404\u79cd\u5f62\u72b6\u548c\u56fe\u6848\u3002\u4e86\u89e3\u66f4\u591a\u57fa\u672c\u547d\u4ee4\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u52a0\u7075\u6d3b\u5730\u4f7f\u7528turtle\u3002<\/p>\n<p><strong>\u5728\u4f7f\u7528turtle\u5e93\u65f6\uff0c\u5982\u4f55\u5904\u7406\u7a97\u53e3\u7684\u5173\u95ed\u548c\u4e8b\u4ef6\uff1f<\/strong><br \/>\u5728\u4f7f\u7528turtle\u5e93\u7ed8\u56fe\u65f6\uff0c\u7a97\u53e3\u901a\u5e38\u4f1a\u4fdd\u6301\u5f00\u542f\u72b6\u6001\uff0c\u76f4\u5230\u60a8\u624b\u52a8\u5173\u95ed\u5b83\u3002\u4e3a\u4e86\u5728\u7ed8\u56fe\u5b8c\u6210\u540e\u8ba9\u7a97\u53e3\u4fdd\u6301\u5f00\u542f\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>turtle.done()<\/code>\u3002\u5982\u679c\u60a8\u5e0c\u671b\u5728\u7a97\u53e3\u4e2d\u5904\u7406\u66f4\u591a\u4e8b\u4ef6\uff0c\u6bd4\u5982\u952e\u76d8\u6216\u9f20\u6807\u8f93\u5165\uff0c\u53ef\u4ee5\u4f7f\u7528<code>turtle.listen()<\/code>\u548c\u76f8\u5173\u7684\u4e8b\u4ef6\u7ed1\u5b9a\u65b9\u6cd5\u3002\u8fd9\u6837\u7684\u8bbe\u7f6e\u53ef\u4ee5\u8ba9\u60a8\u7684\u7ed8\u56fe\u7a0b\u5e8f\u66f4\u52a0\u4e92\u52a8\u548c\u751f\u52a8\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728turtle\u7ed8\u56fe\u4e2d\u4f7f\u7528\u989c\u8272\u548c\u586b\u5145\u6548\u679c\uff1f<\/strong><br \/>turtle\u5e93\u652f\u6301\u591a\u79cd\u989c\u8272\u548c\u586b\u5145\u6548\u679c\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7<code>turtle.color()<\/code>\u8bbe\u7f6e\u7ed8\u56fe\u989c\u8272\uff0c\u901a\u8fc7<code>turtle.fillcolor()<\/code>\u8bbe\u7f6e\u586b\u5145\u989c\u8272\u3002\u5728\u7ed8\u5236\u5f62\u72b6\u4e4b\u524d\uff0c\u4f7f\u7528<code>turtle.begin_fill()<\/code>\u548c<code>turtle.end_fill()<\/code>\u6765\u5b9e\u73b0\u586b\u5145\u6548\u679c\u3002\u8fd9\u4e9b\u529f\u80fd\u4f7f\u5f97\u60a8\u7684\u56fe\u5f62\u66f4\u52a0\u4e30\u5bcc\u591a\u5f69\uff0c\u589e\u5f3a\u4e86\u89c6\u89c9\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u8fd0\u884cPython\u7ed8\u56fe\u5e93Turtle \u8981\u8fd0\u884cPython\u7ed8\u56fe\u5e93Turtle\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5df2\u5b89\u88c5Python\u53ca [&hellip;]","protected":false},"author":3,"featured_media":1169798,"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\/1169790"}],"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=1169790"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1169790\/revisions"}],"predecessor-version":[{"id":1169799,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1169790\/revisions\/1169799"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1169798"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1169790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1169790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1169790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}