{"id":27,"date":"2025-09-25T09:28:12","date_gmt":"2025-09-25T01:28:12","guid":{"rendered":"http:\/\/www.pyteam.cn\/?p=27"},"modified":"2025-10-10T10:24:01","modified_gmt":"2025-10-10T02:24:01","slug":"%e7%ac%ac1%e8%af%bepython-%e5%ae%89%e8%a3%85%e3%80%81%e9%9b%86%e6%88%90%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%8f%8a%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"http:\/\/www.pyteam.cn\/index.php\/2025\/09\/25\/%e7%ac%ac1%e8%af%bepython-%e5%ae%89%e8%a3%85%e3%80%81%e9%9b%86%e6%88%90%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%8f%8a%e7%ae%80%e4%bb%8b\/","title":{"rendered":"Python \u5b89\u88c5\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\u53ca\u7b80\u4ecb"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li><strong>\u5b89\u88c5python\u7f16\u7a0b\u73af\u5883<\/strong><\/li>\n<\/ol>\n\n\n\n<p>\u6211\u4eec\u60f3\u8981\u4f7f\u7528 Python \u8fdb\u884c\u7f16\u7a0b\uff0c\u5c31\u5fc5\u987b\u5728\u7535\u8111\u4e0a\u642d\u5efa\u5fc5\u8981\u7684\u7f16\u8bd1\u73af\u5883\uff0c\u5b89\u88c5\u65b9\u6cd5\u4e0d\u590d\u6742\uff0c\u5e76\u4e0d\u590d\u6742\uff0c\u53ea\u9700\u8981\u4e0b\u8f7d Python \u5b89\u88c5\u8f6f\u4ef6\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/www.python.org\/downloads\/<\/p>\n\n\n\n<p>\u5f53\u524d Python \u6709\u4e24\u4e2a\u5927\u7cfb\u5217\u7684\u7248\u672c\uff0c2.x \u548c 3.x\uff0c\u6211\u4eec\u662f\u4ee5 3.x \u4f5c\u4e3a\u5b66\u4e60\u7684\u5bf9\u8c61\u3002\u6240\u4ee5\u5e94\u9009\u62e9\u201dDownload Python 3.x\u201d\u6309\u94ae\u8fdb\u5165\u4e0b\u8f7d\u9875\u9762\u3002<\/p>\n\n\n\n<p>\u8fdb\u5165\u4e0b\u8f7d\u9875\u9762\u4e4b\u540e\u6211\u4eec\u5c31\u9009\u201cWindows x86 executable installer\u201d\uff0c\u5982\u679c\u662f 64 \u4f4d\u7cfb\u7edf\u9009\u201cWindows x86-64 executable installer\u201d\uff0c\u8fdb\u884c\u4e0b\u8f7d\u3002<\/p>\n\n\n\n<p>\u4e0b\u8f7d\u4e4b\u540e\uff0c\u5c31\u548c\u5b89\u88c5\u5176\u4ed6\u8f6f\u4ef6\u4e00\u6837\uff0c\u4e00\u8def\u201cNext\u201d\u4e0b\u53bb\u5373\u53ef\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"553\" height=\"121\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/1.jpg\" alt=\"\" class=\"wp-image-28\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/1.jpg 553w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/1-300x66.jpg 300w\" sizes=\"auto, (max-width: 553px) 100vw, 553px\" \/><\/figure>\n\n\n\n<p>\u5b89\u88c5\u5b8c\u6bd5\u4e4b\u540e\uff0c\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u6240\u6709\u7a0b\u5e8f\u4e2d\uff0c\u53ef\u4ee5\u627e\u5230[Python 3.X]\u4e2d\u6709\u4e2a IDLE (Python 3.x 32-bit)\uff0c\u70b9\u51fb\u8fd0\u884c\u5c31\u4f1a\u51fa\u73b0\u4e00\u4e2a\u7c7b\u4f3c\u4e8e DOS\u7a97\u53e3\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<p>&gt;&gt;&gt;\u540e\u9762\u6709\u5149\u6807\u5728\u95ea\u52a8\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u5728\u8fd9\u91cc\u8fdb\u884c\u7a0b\u5e8f\u7684\u7f16\u5199\uff0c\u6572\u51fb\u56de\u8f66\uff0cPython \u5c31\u4f1a\u6267\u884c\u6211\u4eec\u7f16\u5199\u7684\u4ee3\u7801\uff0c\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u4f8b\u9898\uff1a\u5728 IDLE \u4e2d\u4f7f\u7528 print \u8bed\u53e5\u8f93\u51fa\u201dHelloworld\u201d\u3002<\/p>\n\n\n\n<p>&gt;&gt;&gt;print(\u201cHelloworld\u201d)<\/p>\n\n\n\n<p>\u5982\u679c\u5c4f\u5e55\u4e0a\u80fd\u591f\u663e\u793a<\/p>\n\n\n\n<p>&gt;&gt;&gt;Helloworld<\/p>\n\n\n\n<p>\u5219\u8868\u660e\u7535\u8111\u4e0a\u7684 Python \u7f16\u8bd1\u73af\u5883\u5df2\u7ecf\u5b89\u88c5\u597d\u4e86\u3002<\/p>\n\n\n\n<p><strong>print <\/strong><strong>\u8bed\u53e5<\/strong><\/p>\n\n\n\n<p>print \u4e2d\u6587\u610f\u601d\u662f\u6253\u5370\uff0c\u662f\u6211\u4eec\u4ee5\u540e\u8981\u7ecf\u5e38\u7528\u5230\u7684\u4e00\u4e2a\u8bed\u53e5\u3002\u5728Python \u7f16\u7a0b\u91cc\u9762\uff0c\u5b83\u5e76\u4e0d\u662f\u8981\u5f80\u7eb8\u4e0a\u6253\u5370\uff0c\u800c\u662f\u6253\u5370\u5728\u547d\u4ee4\u884c\u6216\u8005\u79f0\u4e3a\u63a7\u5236\u53f0\u91cc\u9762\u3002<\/p>\n\n\n\n<p>print \u8bed\u53e5\u7684\u57fa\u672c\u683c\u5f0f:print(\u4f60\u60f3\u8981\u8f93\u51fa\u7684\u5185\u5bb9)\uff0c\u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u662f\u8fd9\u91cc\u7684\u62ec\u53f7\u662f\u82f1\u6587\u62ec\u53f7\uff0c\u5207\u5fcc\u5199\u6210\u4e2d\u6587\u62ec\u53f7\uff0c\u4ee5\u540e\u7f16\u7a0b\u7528\u5230\u7684\u5404\u7c7b\u7b26\u53f7\u5747\u662f\u82f1\u6587\u7b26\u53f7\u3002\u5982\u4e0b\u5b9e\u4f8b\uff0c\u5728\u63a7\u5236\u53f0\u8f93\u51fa\u201dHelloworld\u201d<\/p>\n\n\n\n<p>&gt;&gt;&gt;print(\u201cHelloworld\u201d)<\/p>\n\n\n\n<p><strong>\u7ec3\u4e60 1\uff1a<\/strong><\/p>\n\n\n\n<p>&gt;&gt;&gt;print(\u201cHelloworld\u201d)<\/p>\n\n\n\n<p>&gt;&gt;&gt;print(\u2018Helloworld\u2019)<\/p>\n\n\n\n<p>\u89c2\u5bdf\u7ed3\u679c\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\uff0c\u4e0d\u8bba\u4f7f\u7528\u5355\u5f15\u53f7(\u82f1\u6587)\u8fd8\u662f\u53cc\u5f15\u53f7(\u82f1\u6587)\uff0c\u5747\u53ef\u4ee5\u8f93\u51fa Helloworld\uff0c\u8fd9\u4e9b\u6587\u5b57\uff0c\u6ca1\u9519\uff0c\u5728 Python \u4e2d\u4f7f\u7528\u5355\u5f15\u53f7\u6216\u53cc\u5f15\u53f7\u5f15\u8d77\u6765\u7684\u6587\u5b57\uff0c\u6211\u4eec\u79f0\u4e4b\u4e3a\u5b57\u7b26\u4e32(\u540e\u9762\u4f1a\u8bb2\u89e3\u4ec0\u4e48\u662f\u5b57\u7b26\u4e32)\u3002\u5bf9\u4e8e\u5b57\u7b26\u4e32 print \u4f1a\u539f\u6837\u8f93\u51fa\u5b57\u7b26\u4e32\u7684\u5185\u5bb9\u81f3\u63a7\u5236\u53f0\u3002<\/p>\n\n\n\n<p>\u800c\u4e14\u6bcf\u4e00\u4e2a print \u8f93\u51fa\u7ed3\u675f\u65f6\uff0c\u603b\u4f1a\u5728\u4e00\u884c\u540e\u52a0\u56de\u8f66\u3002\u8bf7\u8bb0\u4f4f\u8fd9\u4e00\u7279\u70b9\u3002<\/p>\n\n\n\n<p><strong>\u7ec3\u4e60 2\uff1a<\/strong><\/p>\n\n\n\n<p>&gt;&gt;&gt;print(1)<\/p>\n\n\n\n<p>&gt;&gt;&gt;print(3.14)<\/p>\n\n\n\n<p>\u89c2\u5bdf\u7ed3\u679c\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\uff0cprint \u8bed\u53e5\u5bf9\u4e8e\u6570\u5b57(\u6574\u6570\u548c\u5c0f\u6570)\uff0c\u90fd\u4f1a\u539f\u6837\u8f93\u51fa\u3002<\/p>\n\n\n\n<p><strong>\u7ec3\u4e60 3\uff1a<\/strong><\/p>\n\n\n\n<p>&gt;&gt;&gt;print(1+2+3)<\/p>\n\n\n\n<p>&gt;&gt;&gt;print(2*3+7)<\/p>\n\n\n\n<p>\u89c2\u5bdf\u7ed3\u679c\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\uff0cprint \u8bed\u53e5\u5bf9\u4e8e\u8fd9\u6837\u5b50\u7684\u6570\u5b66\u5f0f\u5b50(\u79f0\u4e3a\u8868\u8fbe\u5f0f)\uff0c\u4e0d\u4f1a\u539f\u6837\u8f93\u51fa\uff0c\u800c\u662f\u8f93\u51fa\u8868\u8fbe\u5f0f\u7684\u8ba1\u7b97\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u4e09\u4e2a\u52a8\u624b\u7ec3\u4e60\uff0c\u6211\u4eec\u53ef\u4ee5\u603b\u7ed3\u51fa print \u8bed\u53e5\u53ef\u4ee5\u8f93\u51fa\uff1a<\/p>\n\n\n\n<p>\u2460\u5b57\u7b26\u4e32\u2461\u6570\u5b57\u2462\u8868\u8fbe\u5f0f\u8ba1\u7b97\u7ed3\u679c\uff0c\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7\u4e0a\u9762\u7684\u7ec3\u4e60\u6211\u4eec\u53d1\u73b0 print \u5728\u8f93\u51fa\u7684\u65f6\u5019\uff0c\u6bcf\u4e00\u4e2a print \u8f93\u51fa\u7ed3\u675f\u4e4b\u540e\u5747\u4f1a\u8f93\u51fa\u4e00\u4e2a\u56de\u8f66\uff0c\u90a3\u4e48\u5982\u679c\u60f3\u8981\u628a\u8f93\u51fa\u7684\u6570\u636e\u5728\u4e00\u884c\u4e0a\u600e\u4e48\u529e\u5462\uff1f\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a print \u8bed\u53e5\uff0c\u6307\u5b9a\u591a\u4e2a\u60f3\u8981\u8f93\u51fa\u7684\u5185\u5bb9\u3002<\/p>\n\n\n\n<p>\u7ec3\u4e60 4\uff1a<\/p>\n\n\n\n<p>&gt;&gt;&gt;print(\u201c\u52a0\u6cd5\u8ba1\u7b97&nbsp;3+8=\u201d,3+8)<\/p>\n\n\n\n<p>\u4e0a\u9762\u7684\u7ec3\u4e60\u4e00\u884c\u4e2d\u8f93\u51fa\u4e86\u4e24\u4e2a\u6570\u636e\uff0c\u7b2c\u4e00\u4e2a\u6570\u636e\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u7b2c\u4e8c\u4e2a\u6570\u636e\u662f\u4e00\u4e2a\u8868\u8fbe\u5f0f 3+8 \u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<p><strong>\u5982\u679c\u8fd8\u6709\u66f4\u591a\u7684\u6570\u636e\u8981\u5728\u4e00\u884c\u8f93\u51fa\uff0c\u5219\u7ee7\u7eed\u5728 print \u4e2d\u6307\u5b9a\u5373\u53ef\u3002<\/strong><\/p>\n\n\n\n<p>print(\u5185\u5bb9 1,\u5185\u5bb9 2,\u5185\u5bb9 3,\u2026\u2026)<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u00a0IDE<\/strong><strong>\u96c6\u6210\u5f00\u53d1\u73af\u5883<\/strong><\/li>\n<\/ol>\n\n\n\n<p>IDE \u53eb\u505a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u4f7f\u6211\u4eec\u7528\u6765\u7f16\u5199\u7a0b\u5e8f\u8c03\u8bd5\u7a0b\u5e8f\u7684\u4e00\u4e2a\u8f6f\u4ef6\uff0c\u6211\u4eec\u7f16\u5199Python\u7a0b\u5e8f\uff0c\u4e5f\u9700\u8981\u4f7f\u7528\u4e00\u4e2a IDE \u7f16\u7a0b\u8f6f\u4ef6\uff0c\u5c31\u597d\u6bd4\u6211\u4eec\u7f16\u8f91doc\u6587\u6863\u9700\u8981word\u4e00\u6837\u3002\u5728\u7b2c\u4e00\u8bfe\u4e2d\u6211\u4eec\u7528\u5230\u7684IDLE\u5c31\u662fPython\u81ea\u5e26\u7684\u4e00\u6b3eIDE\u7f16\u7a0b\u8f6f\u4ef6\uff0c\u5f53\u7136\u8fd8\u6709\u5f88\u591a\u522b\u7684IDE \u8f6f\u4ef6\u53ef\u4ee5\u7f16\u8bd1Python\uff0c\u672c\u4e66\u5c31\u4ee5 IDLE \u4f5c\u4e3aIDE\u8fdb\u884cPython\u5b66\u4e60\u3002<\/p>\n\n\n\n<p>IDLE\u6709\u4e24\u79cd\u7f16\u5199Python\u8bed\u53e5\u7684\u65b9\u5f0f\uff0c\u7b2c\u4e00\u79cd\u5c31\u662f\u6211\u4eec\u4e0a\u8282\u8bfe\u7528\u5230\u8fc7\u7684\u65b9\u5f0f\uff0c\u76f4\u63a5\u5728IDLE\u63a7\u5236\u53f0\u4e66\u5199\u4ee3\u7801\uff0c\u6572\u51fb\u56de\u8f66\u4f1a\u663e\u793a\u8fd0\u884c\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u6709\u4e24\u4e2a\u7279\u70b9\uff1a<\/p>\n\n\n\n<p>1\u3001\u7f16\u5199\u4e00\u6761\u8bed\u53e5\uff0c\u6267\u884c\u4e00\u6761\u8bed\u53e5\uff0c\u663e\u793a\u7ed3\u679c\u3002<\/p>\n\n\n\n<p>2\u3001\u5f53\u6211\u4eec\u628a IDLE \u5173\u95ed\u4e4b\u540e\uff0c\u6211\u4eec\u7f16\u5199\u7684\u7a0b\u5e8f\u4ee3\u7801\u65e0\u6cd5\u4fdd\u5b58\u3002\u6240\u4ee5\u8fd9\u79cd\u65b9\u6cd5\u662f\u65e0\u6cd5\u6ee1\u8db3\u6211\u4eec\u5b9e\u73b0\u7f16\u5199\u590d\u6742\u7a0b\u5e8f\u7684\u8981\u6c42\uff0c\u8fd9\u65f6\u6211\u4eec\u9700\u8981\u7b2c\u4e8c\u79cd\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>\u70b9\u51fb IDLE \u5de6\u4e0a\u89d2\u7684[file]\u83dc\u5355\uff0c\u9009\u62e9[New File]\uff0c\u5c31\u4f1a\u6253\u5f00\u4e00\u4e2a\u65b0\u7684\u7a7a\u767d\u7a97\u53e3\uff0c\u8fd9\u5c31\u662f\u4e00\u4e2a\u6587\u672c\u7f16\u8f91\u5668\uff0c\u6211\u4eec\u53ef\u4ee5\u5728\u91cc\u9762\u7f16\u5199 Python\u7a0b\u5e8f\u4ee3\u7801\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"309\" height=\"233\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/2.jpg\" alt=\"\" class=\"wp-image-29\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/2.jpg 309w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/2-300x226.jpg 300w\" sizes=\"auto, (max-width: 309px) 100vw, 309px\" \/><\/figure>\n\n\n\n<p>\u5728[Run]\u83dc\u5355\u4e2d\u9009\u62e9[Run Module]\u6216\u8005\u76f4\u63a5\u70b9\u51fb F5\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"458\" height=\"185\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/3.jpg\" alt=\"\" class=\"wp-image-30\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/3.jpg 458w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/3-300x121.jpg 300w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/figure>\n\n\n\n<p>\u4f1a\u5f39\u51fa\u4e00\u4e2a\u5bf9\u8bdd\u6846\uff0c\u63d0\u793a\u6211\u4eec\u4fdd\u5b58\u4e00\u4e0b\u521a\u624d\u7f16\u5199\u7684\u4ee3\u7801\uff0c\u5c31\u597d\u6bd4\u6211\u4eec\u65b0\u5efa\u7684doc\u6587\u6863\uff0c\u9700\u8981\u4fdd\u5b58\u4e00\u6837\uff0c\u6211\u4eec\u7f16\u5199\u7684\u4ee3\u7801\u518d\u7b2c\u4e00\u6b21\u8fd0\u884c\u7684\u65f6\u5019\u4e5f\u9700\u8981\u4fdd\u5b58\u6210\u4e00\u4e2apy\u683c\u5f0f\u6587\u4ef6(Python \u540e\u7f00\u540d\u662f.py)\uff0c\u8fd9\u6837\u5b50\u6211\u4eec\u7684\u7a0b\u5e8f\u4ee3\u7801\u5c31\u4f1a\u88ab\u4e00\u76f4\u4fdd\u7559\u4e0b\u6765\u4e86\u3002\u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"252\" height=\"190\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/4.jpg\" alt=\"\" class=\"wp-image-31\" style=\"width:301px;height:auto\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"434\" height=\"304\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/5.jpg\" alt=\"\" class=\"wp-image-32\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/5.jpg 434w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/5-300x210.jpg 300w\" sizes=\"auto, (max-width: 434px) 100vw, 434px\" \/><\/figure>\n<\/div><\/div>\n\n\n\n<p>\u5f53\u4fdd\u5b58\u5b8c\u6bd5\u4e4b\u540e\uff0c\u6211\u4eec\u7f16\u5199\u7684\u7a0b\u5e8f\u4ee3\u7801\u5c31\u4f1a\u88ab\u7f16\u8bd1\u6267\u884c\uff0c\u7ed3\u679c\u4f1a\u4e00\u6b21\u6027\u663e\u793a\u5230 IDLE \u7684\u63a7\u5236\u53f0\u4e2d\u3002<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u00a0turtle<\/strong><strong>\u7ed8\u56fe\u5e93\u4ecb\u7ecd<\/strong><\/li>\n<\/ol>\n\n\n\n<p>&nbsp;python \u4e2d\u5305\u542b\u4e00\u4e2a\u7b80\u5355\u7684\u7ed8\u56fe\u5de5\u5177\uff0c\u53eb\u505a\u6d77\u9f9f\u7ed8\u56fe(TurtleGraphics),turtle \u5e93\u662f python \u7684\u5185\u90e8\u5e93\uff0c\u65e0\u9700\u989d\u5916\u5b89\u88c5\uff0c\u7528import\u8bed\u53e5\u5bfc\u5165\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n\n\n\n<p><strong>\u4ec0\u4e48\u662f\u5e93\uff1f<\/strong><\/p>\n\n\n\n<p>\u53ef\u4ee5\u8ba4\u4e3a\u5e93\u662f\u522b\u4eba\u5199\u597d\u7684\u4e00\u4e9b\u7a0b\u5e8f\u5de5\u5177\uff0c\u6211\u4eec\u5728\u60f3\u8981\u4f7f\u7528\u8fd9\u4e9b\u5de5\u5177\u7684\u65f6\u5019\u5c31\u4e0d\u5fc5\u81ea\u5df1\u518d\u91cd\u590d\u5199\u4ee3\u7801\uff0c\u76f4\u63a5\u4f7f\u7528\u522b\u4eba\u5199\u597d\u7684\u8fd9\u4e9b\u5e93\u91cc\u9762\u7684\u5de5\u5177\u5373\u53ef\u3002<\/p>\n\n\n\n<p><strong>\u600e\u4e48\u4f7f\u7528\u522b\u4eba\u5199\u7684\u5e93\u5462\uff1f<\/strong><\/p>\n\n\n\n<p>\u7528&nbsp;import&nbsp;\u8bed\u53e5\u5c31\u53ef\u4ee5\u5c06\u522b\u4eba\u5199\u7684\u5de5\u5177\u5e93\u5bfc\u5165\u5230\u6211\u4eec\u7684\u7a0b\u5e8f\u4e2d\uff0c\u8fd9\u4e9b\u5de5\u5177\u5c31\u53ef\u4ee5\u4e3a\u6211\u4eec\u6240\u7528\u3002<\/p>\n\n\n\n<p>import&nbsp;\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<p><strong>import<\/strong><strong>&nbsp;<\/strong><strong>\u5e93\u540d<\/strong><\/p>\n\n\n\n<p>\u4f8b\u5982\u60f3\u8981\u5bfc\u5165&nbsp;turtle&nbsp;\u7ed8\u56fe\u5e93\uff0c\u8bed\u53e5\u5982\u4e0b<\/p>\n\n\n\n<p>import&nbsp;trutle<\/p>\n\n\n\n<p><strong>\u4f8b1\uff1a<\/strong>\u4f7f\u7528turtle\u7ed8\u56fe\u5e93\uff0c\u753b\u4e00\u6761\u957f\u5ea6\u4e3a100\u50cf\u7d20\u76f4\u7ebf\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"130\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/6.jpg\" alt=\"\" class=\"wp-image-33\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/6.jpg 558w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/6-300x70.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/figure>\n\n\n\n<p>\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"249\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/7-1.jpg\" alt=\"\" class=\"wp-image-35\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/7-1.jpg 558w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/7-1-300x134.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/figure>\n\n\n\n<p>\u901a\u8fc7\u89c2\u770b\uff0c\u6211\u4eec\u4f1a\u770b\u5230\u8fd0\u884c\u4e4b\u540e\uff0c\u7ed8\u56fe\u662f\u5728\u4e00\u4e2a\u201cPython TurtleGraphics\u201d\u5bf9\u8bdd\u6846\u4e2d\u663e\u793a\u7684\uff0c\u8fd9\u4e2a\u5bf9\u8bdd\u6846\u5c31\u662f turtle \u5e93\u8fdb\u884c\u7ed8\u56fe\u7684\u5730\u65b9\uff0c\u79f0\u4e4b\u4e3a\u201c\u753b\u5e03\u201d\u3002<\/p>\n\n\n\n<p>\u753b\u5e03\u5c31\u597d\u6bd4\u4e00\u5f20\u753b\u7eb8\uff0c\u5176\u5927\u5c0f\u51b3\u5b9a\u4e86\u6211\u4eec\u53ef\u4ee5\u5728\u4e0a\u9762\u753b\u51fa\u56fe\u50cf\u7684\u591a\u5c11\u548c\u5927\u5c0f\uff0c\u753b\u5e03\u9ed8\u8ba4\u5927\u5c0f\u4e3a\uff1a\u5bbd 400 \u50cf\u7d20\uff0c\u9ad8 300 \u50cf\u7d20\u3002\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8c03\u8282\u753b\u56fe\u7684\u5927\u5c0f\uff0c\u8c03\u8282\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>turtle.screensize(canvwidth=None,canvheight=None, bg=None)<\/p>\n\n\n\n<p>\u53c2\u6570\u5206\u522b\u4e3a\uff1a\u753b\u5e03\u7684\u5bbd(\u5355\u4f4d\u50cf\u7d20), \u753b\u5e03\u7684\u9ad8, \u753b\u5e03\u7684\u80cc\u666f\u989c\u8272\u3002<\/p>\n\n\n\n<p><strong>\u4f8b2\uff1a<\/strong>\u4f7f\u7528turtle\u7ed8\u56fe\u5e93\uff0c\u4fee\u6539\u753b\u5e03\u5927\u5c0f\u4e3a800\u50cf\u7d20\u5bbd\u3001600\u50cf\u7d20\u9ad8\uff0c\u5e76\u753b\u4e00\u6761\u5ea6\u4e3a100\u50cf\u7d20\u76f4\u7ebf\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"56\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/8.jpg\" alt=\"\" class=\"wp-image-36\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/8.jpg 558w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/8-300x30.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/figure>\n\n\n\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"555\" height=\"311\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/9.jpg\" alt=\"\" class=\"wp-image-37\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/9.jpg 555w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/9-300x168.jpg 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/figure>\n\n\n\n<p><strong>\u4f8b3\uff1a<\/strong>\u4f7f\u7528turtle\u7ed8\u56fe\u5e93\uff0c\u753b\u4e00\u4e2a\u534a\u5f8480\u50cf\u7d20\u7684\u5706\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"93\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/11-1024x93.png\" alt=\"\" class=\"wp-image-39\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/11-1024x93.png 1024w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/11-300x27.png 300w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/11-768x70.png 768w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/11.png 1458w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8fd0\u884c\u7ed3\u679c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"937\" height=\"306\" src=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/10.png\" alt=\"\" class=\"wp-image-38\" srcset=\"http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/10.png 937w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/10-300x98.png 300w, http:\/\/www.pyteam.cn\/wp-content\/uploads\/2025\/09\/10-768x251.png 768w\" sizes=\"auto, (max-width: 937px) 100vw, 937px\" \/><\/figure>\n\n\n\n<p>\u601d\u8003\u9898\uff1a\u601d\u8003\u5982\u4f55\u753b\u4e00\u4e2a\u4e09\u89d2\u5f62\uff1f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eec\u60f3\u8981\u4f7f\u7528 Python \u8fdb\u884c\u7f16\u7a0b\uff0c\u5c31\u5fc5\u987b\u5728\u7535\u8111\u4e0a\u642d\u5efa\u5fc5\u8981\u7684\u7f16\u8bd1\u73af&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":67,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,4],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","category-4"],"views":516,"_links":{"self":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":2,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":130,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/posts\/27\/revisions\/130"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media\/67"}],"wp:attachment":[{"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.pyteam.cn\/index.php\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}