{"id":1168127,"date":"2025-01-15T15:54:19","date_gmt":"2025-01-15T07:54:19","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1168127.html"},"modified":"2025-01-15T15:54:22","modified_gmt":"2025-01-15T07:54:22","slug":"%e5%ae%89%e5%8d%93%e7%b3%bb%e7%bb%9f%e5%a6%82%e4%bd%95%e8%bf%90%e8%a1%8cpython","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1168127.html","title":{"rendered":"\u5b89\u5353\u7cfb\u7edf\u5982\u4f55\u8fd0\u884cpython"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26065443\/b8fbdedc-1890-4777-bc8b-4ad22491a7ae.webp\" alt=\"\u5b89\u5353\u7cfb\u7edf\u5982\u4f55\u8fd0\u884cpython\" \/><\/p>\n<p><p> \u5b89\u5353\u7cfb\u7edf\u8fd0\u884cPython\u7684\u65b9\u5f0f\u6709\u5f88\u591a\u79cd\uff0c\u4e3b\u8981\u5305\u62ec\uff1a<strong>\u4f7f\u7528Python\u89e3\u91ca\u5668\u5e94\u7528\u3001\u501f\u52a9Termux\u3001\u901a\u8fc7QPython\u3001\u5229\u7528Pydroid 3\u3001\u6784\u5efaKivy\u5e94\u7528<\/strong>\u7b49\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u4f7f\u7528Python\u89e3\u91ca\u5668\u5e94\u7528\u7684\u65b9\u5f0f\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528Python\u89e3\u91ca\u5668\u5e94\u7528<\/strong>\uff1a\u901a\u8fc7\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u5b89\u88c5Python\u89e3\u91ca\u5668\u5e94\u7528\uff0c\u5982Pydroid 3\u6216QPython\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u624b\u673a\u4e0a\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002Pydroid 3\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684Python IDE\uff0c\u652f\u6301\u5927\u90e8\u5206Python\u5e93\uff0c\u5e76\u4e14\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u6d01\u7684\u7528\u6237\u754c\u9762\uff0c\u65b9\u4fbf\u7528\u6237\u5728\u624b\u673a\u4e0a\u8fdb\u884c\u7f16\u7a0b\u3002\u901a\u8fc7Pydroid 3\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u5b89\u88c5\u5404\u79cdPython\u5e93\uff0c\u7f16\u5199\u3001\u8c03\u8bd5\u548c\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528Python\u89e3\u91ca\u5668\u5e94\u7528<\/h3>\n<\/p>\n<p><p>1\u3001<strong>Pydroid 3<\/strong><\/p>\n<\/p>\n<p><p>Pydroid 3\u662f\u4e00\u6b3e\u5f3a\u5927\u7684Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u4e13\u4e3a\u5b89\u5353\u8bbe\u5907\u8bbe\u8ba1\u3002\u5b83\u652f\u6301\u5927\u90e8\u5206Python\u5e93\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u7b80\u6d01\u7684\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u624b\u673a\u4e0a\u8f7b\u677e\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Pydroid 3\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Pydroid 3\u5e94\u7528\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u7b80\u5355\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u754c\u9762\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199Python\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u5e93<\/strong>\uff1a<\/p>\n<p>Pydroid 3\u5185\u7f6e\u4e86\u4e00\u4e2a\u7b80\u5316\u7248\u7684pip\uff0c\u5141\u8bb8\u7528\u6237\u5b89\u88c5\u5e38\u7528\u7684Python\u5e93\u3002\u6253\u5f00\u5e94\u7528\u540e\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u83dc\u5355\u6309\u94ae\uff0c\u9009\u62e9\u201cPip\u201d\uff0c\u7136\u540e\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u8f93\u5165\u60a8\u9700\u8981\u5b89\u88c5\u7684\u5e93\u540d\u79f0\uff0c\u4f8b\u5982<code>numpy<\/code>\u6216<code>pandas<\/code>\uff0c\u70b9\u51fb\u201cInstall\u201d\u5373\u53ef\u5b89\u88c5\u5bf9\u5e94\u7684\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5728Pydroid 3\u7684\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002\u60a8\u53ef\u4ee5\u50cf\u5728\u684c\u9762IDE\u4e2d\u4e00\u6837\u8c03\u8bd5\u4ee3\u7801\uff0c\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>QPython<\/strong><\/p>\n<\/p>\n<p><p>QPython\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Python\u89e3\u91ca\u5668\u5e94\u7528\uff0c\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u8fd8\u652f\u6301\u591a\u4e2aPython\u7248\u672c\u548c\u6269\u5c55\u5e93\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22QPython\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00QPython\u5e94\u7528\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u754c\u9762\uff0c\u5305\u62ec\u7f16\u8f91\u5668\u3001\u7ec8\u7aef\u548c\u5e93\u7ba1\u7406\u5668\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5\u5e93<\/strong>\uff1a<\/p>\n<p>QPython\u5185\u7f6e\u4e86\u4e00\u4e2a\u5e93\u7ba1\u7406\u5668\uff0c\u5141\u8bb8\u7528\u6237\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u3002\u6253\u5f00QPython\u540e\uff0c\u70b9\u51fb\u201c\u5e93\u201d\u9009\u9879\u5361\uff0c\u641c\u7d22\u5e76\u5b89\u88c5\u60a8\u9700\u8981\u7684\u5e93\uff0c\u4f8b\u5982<code>requests<\/code>\u6216<code>flask<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>\u5728QPython\u7684\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0b\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002QPython\u8fd8\u652f\u6301\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u63d0\u4f9b\u66f4\u591a\u7684\u7075\u6d3b\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u501f\u52a9Termux<\/h3>\n<\/p>\n<p><p>Termux\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u7ec8\u7aef\u4eff\u771f\u5668\u548cLinux\u73af\u5883\uff0c\u5141\u8bb8\u7528\u6237\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884c\u5404\u79cdLinux\u547d\u4ee4\u548c\u7a0b\u5e8f\uff0c\u5305\u62ecPython\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5Termux<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Termux\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Termux\u5e94\u7528\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u7c7bUnix\u7684\u547d\u4ee4\u884c\u754c\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python<\/strong>\uff1a<\/p>\n<p>\u5728Termux\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pkg update<\/p>\n<p>pkg install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5pip<\/strong>\uff1a<\/p>\n<p>Python\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5pip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pkg install python-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u5b89\u88c5\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u5728Termux\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5Python\u5e93\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install numpy<\/p>\n<p>pip install pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>3\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Termux\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u7ec8\u7aef\u5185\u7f6e\u7684\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982nano\u6216vim\uff09\u7f16\u5199Python\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u4f7f\u7528nano\u7f16\u8f91\u5668\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">nano myscript.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668\u3002\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python myscript.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e09\u3001\u901a\u8fc7QPython<\/h3>\n<\/p>\n<p><p>QPython\u662f\u4e00\u6b3e\u529f\u80fd\u4e30\u5bcc\u7684Python\u89e3\u91ca\u5668\u5e94\u7528\uff0c\u652f\u6301\u591a\u4e2aPython\u7248\u672c\u548c\u6269\u5c55\u5e93\u3002\u5b83\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u8fd8\u652f\u6301\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5QPython<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22QPython\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00QPython\u5e94\u7528\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u754c\u9762\uff0c\u5305\u62ec\u7f16\u8f91\u5668\u3001\u7ec8\u7aef\u548c\u5e93\u7ba1\u7406\u5668\u3002<\/li>\n<\/p>\n<\/ul>\n<p><p>2\u3001<strong>\u5b89\u88c5\u5e93<\/strong><\/p>\n<\/p>\n<p><p>QPython\u5185\u7f6e\u4e86\u4e00\u4e2a\u5e93\u7ba1\u7406\u5668\uff0c\u5141\u8bb8\u7528\u6237\u5b89\u88c5\u548c\u7ba1\u7406Python\u5e93\u3002\u6253\u5f00QPython\u540e\uff0c\u70b9\u51fb\u201c\u5e93\u201d\u9009\u9879\u5361\uff0c\u641c\u7d22\u5e76\u5b89\u88c5\u60a8\u9700\u8981\u7684\u5e93\uff0c\u4f8b\u5982<code>requests<\/code>\u6216<code>flask<\/code>\u3002<\/p>\n<\/p>\n<p><p>3\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728QPython\u7684\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0b\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002QPython\u8fd8\u652f\u6301\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884cPython\u811a\u672c\uff0c\u63d0\u4f9b\u66f4\u591a\u7684\u7075\u6d3b\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5229\u7528Pydroid 3<\/h3>\n<\/p>\n<p><p>Pydroid 3\u662f\u4e00\u6b3e\u5f3a\u5927\u7684Python\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u4e13\u4e3a\u5b89\u5353\u8bbe\u5907\u8bbe\u8ba1\u3002\u5b83\u652f\u6301\u5927\u90e8\u5206Python\u5e93\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u7b80\u6d01\u7684\u7528\u6237\u754c\u9762\uff0c\u4f7f\u5f97\u7528\u6237\u53ef\u4ee5\u5728\u624b\u673a\u4e0a\u8f7b\u677e\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5Pydroid 3<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Pydroid 3\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Pydroid 3\u5e94\u7528\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u7b80\u5355\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u754c\u9762\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199Python\u4ee3\u7801\u3002<\/li>\n<\/p>\n<\/ul>\n<p><p>2\u3001<strong>\u5b89\u88c5\u5e93<\/strong><\/p>\n<\/p>\n<p><p>Pydroid 3\u5185\u7f6e\u4e86\u4e00\u4e2a\u7b80\u5316\u7248\u7684pip\uff0c\u5141\u8bb8\u7528\u6237\u5b89\u88c5\u5e38\u7528\u7684Python\u5e93\u3002\u6253\u5f00\u5e94\u7528\u540e\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u83dc\u5355\u6309\u94ae\uff0c\u9009\u62e9\u201cPip\u201d\uff0c\u7136\u540e\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u8f93\u5165\u60a8\u9700\u8981\u5b89\u88c5\u7684\u5e93\u540d\u79f0\uff0c\u4f8b\u5982<code>numpy<\/code>\u6216<code>pandas<\/code>\uff0c\u70b9\u51fb\u201cInstall\u201d\u5373\u53ef\u5b89\u88c5\u5bf9\u5e94\u7684\u5e93\u3002<\/p>\n<\/p>\n<p><p>3\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Pydroid 3\u7684\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002\u60a8\u53ef\u4ee5\u50cf\u5728\u684c\u9762IDE\u4e2d\u4e00\u6837\u8c03\u8bd5\u4ee3\u7801\uff0c\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u6784\u5efaKivy\u5e94\u7528<\/h3>\n<\/p>\n<p><p>Kivy\u662f\u4e00\u4e2a\u5f00\u6e90\u7684Python\u5e93\uff0c\u4e13\u4e3a\u5f00\u53d1\u591a\u70b9\u89e6\u63a7\u5e94\u7528\u7a0b\u5e8f\u800c\u8bbe\u8ba1\u3002\u901a\u8fc7Kivy\uff0c\u60a8\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u6784\u5efa\u548c\u8fd0\u884cPython\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5Kivy<\/strong>\uff1a<\/p>\n<p>\u5728Termux\u6216QPython\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5Kivy\u3002\u4f8b\u5982\uff0c\u5728Termux\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-shell\">pip install kivy<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Kivy\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Python\u7f16\u5199\u56fe\u5f62\u7528\u6237\u754c\u9762\uff08GUI\uff09\u5e94\u7528\u7a0b\u5e8f\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Kivy\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from kivy.app import App<\/p>\n<p>from kivy.uix.label import Label<\/p>\n<p>class MyApp(App):<\/p>\n<p>    def build(self):<\/p>\n<p>        return Label(text=&#39;Hello, Kivy!&#39;)<\/p>\n<p>if __name__ == &#39;__m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n__&#39;:<\/p>\n<p>    MyApp().run()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u4e3a<code>myapp.py<\/code>\uff0c\u7136\u540e\u5728Termux\u6216QPython\u4e2d\u8fd0\u884c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python myapp.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528SL4A\uff08Scripting Layer for Android\uff09<\/h3>\n<\/p>\n<p><p>SL4A\uff08Scripting Layer for Android\uff09\u662f\u4e00\u4e2a\u53ef\u4ee5\u5728Android\u8bbe\u5907\u4e0a\u8fd0\u884c\u811a\u672c\u8bed\u8a00\u7684\u6846\u67b6\uff0c\u5305\u62ecPython\u3002SL4A\u63d0\u4f9b\u4e86\u4e00\u7ec4API\uff0c\u5141\u8bb8\u811a\u672c\u4e0e\u8bbe\u5907\u7684\u529f\u80fd\u8fdb\u884c\u4ea4\u4e92\uff0c\u4f8b\u5982\u8bbf\u95ee\u4f20\u611f\u5668\u3001\u63a7\u5236\u6444\u50cf\u5934\u7b49\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5SL4A<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22SL4A\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u8fd8\u9700\u8981\u5b89\u88c5Python for Android\u63d2\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python for Android<\/strong>\uff1a<\/p>\n<p>\u5728SL4A\u5e94\u7528\u4e2d\uff0c\u4e0b\u8f7d\u5e76\u5b89\u88c5Python for Android\u63d2\u4ef6\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u5728SL4A\u754c\u9762\u4e2d\u770b\u5230Python\u8bed\u8a00\u7684\u9009\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728SL4A\u4e2d\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u7f16\u5199\u548c\u8fd0\u884cPython\u811a\u672c\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c<code>hello.py<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import android<\/p>\n<p>droid = android.Android()<\/p>\n<p>droid.makeToast(&#39;Hello, SL4A!&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728SL4A\u5e94\u7528\u4e2d\uff0c\u9009\u62e9\u8fd0\u884c<code>hello.py<\/code>\u811a\u672c\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u63d0\u793a\u6846\u663e\u793a\u201cHello, SL4A!\u201d\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u901a\u8fc7Anaconda<\/h3>\n<\/p>\n<p><p>Anaconda\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u6570\u636e\u79d1\u5b66\u5e73\u53f0\uff0c\u652f\u6301Python\u548cR\u7f16\u7a0b\u8bed\u8a00\u3002\u867d\u7136Anaconda\u4e3b\u8981\u7528\u4e8e\u684c\u9762\u73af\u5883\uff0c\u4f46\u4e5f\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u901a\u8fc7Termux\u6216\u5176\u4ed6Linux\u73af\u5883\u8fdb\u884c\u5b89\u88c5\u548c\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5Termux<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Termux\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Termux\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4e0b\u8f7dAnaconda<\/strong>\uff1a<\/p>\n<p>\u5728Termux\u4e2d\uff0c\u4f7f\u7528<code>wget<\/code>\u547d\u4ee4\u4e0b\u8f7dAnaconda\u5b89\u88c5\u811a\u672c\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">wget https:\/\/repo.anaconda.com\/archive\/Anaconda3-2021.05-Linux-x86_64.sh<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Anaconda<\/strong>\uff1a<\/p>\n<p>\u4e0b\u8f7d\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u5b89\u88c5\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">bash Anaconda3-2021.05-Linux-x86_64.sh<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u4f7f\u7528Anaconda<\/strong><\/p>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Anaconda\u7ba1\u7406Python\u73af\u5883\u548c\u5e93\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u73af\u5883\u5e76\u5b89\u88c5\u6240\u9700\u7684\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">conda create -n myenv python=3.8<\/p>\n<p>conda activate myenv<\/p>\n<p>conda install numpy pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u901a\u8fc7Jupyter Notebook<\/h3>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u6b3e\u6d41\u884c\u7684\u4ea4\u4e92\u5f0f\u5f00\u53d1\u5de5\u5177\uff0c\u5e7f\u6cdb\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u9886\u57df\u3002\u60a8\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884cJupyter Notebook\uff0c\u8fdb\u884c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5Termux<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Termux\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Termux\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Python\u548cpip<\/strong>\uff1a<\/p>\n<p>\u5728Termux\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\u548cpip\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pkg update<\/p>\n<p>pkg install python<\/p>\n<p>pkg install python-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Jupyter Notebook<\/strong>\uff1a<\/p>\n<p>\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip install jupyter<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u542f\u52a8Jupyter Notebook<\/strong><\/p>\n<\/p>\n<p><p>\u5728Termux\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u542f\u52a8\u540e\uff0c\u60a8\u5c06\u5728\u7ec8\u7aef\u4e2d\u770b\u5230\u4e00\u4e2aURL\uff0c\u6253\u5f00\u6d4f\u89c8\u5668\u5e76\u8bbf\u95ee\u8be5URL\uff0c\u5373\u53ef\u8fdb\u5165Jupyter Notebook\u754c\u9762\u3002\u5728\u8fd9\u91cc\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u548c\u7f16\u8f91Notebook\uff0c\u8fdb\u884c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u4e5d\u3001\u901a\u8fc7Dcoder<\/h3>\n<\/p>\n<p><p>Dcoder\u662f\u4e00\u6b3e\u591a\u8bed\u8a00\u5728\u7ebf\u7f16\u7a0b\u5de5\u5177\uff0c\u652f\u6301Python\u3001C++\u3001Java\u7b49\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u3002\u60a8\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u5b89\u88c5Dcoder\u5e94\u7528\uff0c\u8fdb\u884cPython\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5Dcoder<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Dcoder\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Dcoder\u5e94\u7528\u3002<\/li>\n<\/p>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Dcoder\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0b\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002Dcoder\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u6d01\u7684\u7528\u6237\u754c\u9762\uff0c\u65b9\u4fbf\u7528\u6237\u5728\u624b\u673a\u4e0a\u8fdb\u884c\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u3001\u901a\u8fc7Google Colab<\/h3>\n<\/p>\n<p><p>Google Colab\u662f\u4e00\u6b3e\u57fa\u4e8e\u4e91\u7684Jupyter Notebook\u73af\u5883\uff0c\u5e7f\u6cdb\u7528\u4e8e\u6570\u636e\u79d1\u5b66\u548c\u673a\u5668\u5b66\u4e60\u9886\u57df\u3002\u60a8\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95eeGoogle Colab\uff0c\u8fdb\u884c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u8bbf\u95eeGoogle Colab<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5b89\u5353\u8bbe\u5907\u7684\u6d4f\u89c8\u5668\u4e2d\uff0c\u8bbf\u95eeGoogle Colab\u7f51\u7ad9\uff08<a href=\"https:\/\/colab.research.google.com%EF%BC%89%E3%80%82%E7%99%BB%E5%BD%95%E6%82%A8%E7%9A%84Google%E8%B4%A6%E5%8F%B7%E5%90%8E%EF%BC%8C%E5%8D%B3%E5%8F%AF%E5%88%9B%E5%BB%BA%E5%92%8C%E7%BC%96%E8%BE%91Notebook%E3%80%82\">https:\/\/colab.research.google.com\uff09\u3002\u767b\u5f55\u60a8\u7684Google\u8d26\u53f7\u540e\uff0c\u5373\u53ef\u521b\u5efa\u548c\u7f16\u8f91Notebook\u3002<\/a><\/p>\n<\/p>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Google Colab\u4e2d\uff0c\u60a8\u53ef\u4ee5\u521b\u5efa\u65b0\u7684Notebook\uff0c\u5e76\u5728\u5176\u4e2d\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002Colab\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u8ba1\u7b97\u8d44\u6e90\uff0c\u65b9\u4fbf\u60a8\u8fdb\u884c\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e00\u3001\u901a\u8fc7Andronix<\/h3>\n<\/p>\n<p><p>Andronix\u662f\u4e00\u6b3e\u5b89\u5353\u5e94\u7528\uff0c\u5141\u8bb8\u7528\u6237\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884c\u591a\u4e2aLinux\u53d1\u884c\u7248\uff0c\u5305\u62ecUbuntu\u3001Debian\u7b49\u3002\u901a\u8fc7Andronix\uff0c\u60a8\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u6784\u5efa\u5b8c\u6574\u7684Python\u5f00\u53d1\u73af\u5883\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5Andronix<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Andronix\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Andronix\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u9009\u62e9Linux\u53d1\u884c\u7248<\/strong>\uff1a<\/p>\n<p>\u5728Andronix\u5e94\u7528\u4e2d\uff0c\u9009\u62e9\u60a8\u60f3\u8981\u5b89\u88c5\u7684Linux\u53d1\u884c\u7248\uff0c\u4f8b\u5982Ubuntu\u3002\u6309\u7167\u5e94\u7528\u5185\u7684\u6307\u793a\uff0c\u5b8c\u6210Linux\u73af\u5883\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u5b89\u88c5Python<\/strong><\/p>\n<\/p>\n<p><p>\u5728Andronix\u4e2d\uff0c\u8fdb\u5165Linux\u73af\u5883\u540e\uff0c\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt\uff09\u5b89\u88c5Python\u3002\u4f8b\u5982\uff0c\u5728Ubuntu\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">sudo apt update<\/p>\n<p>sudo apt install python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>3\u3001<strong>\u5b89\u88c5\u5e93<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684Python\u5e93\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">pip3 install numpy pandas<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>4\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Andronix\u7684Linux\u73af\u5883\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982nano\u6216vim\uff09\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u901a\u8fc7\u7ec8\u7aef\u8fd0\u884c\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">nano myscript.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165\u4ee3\u7801\uff0c\u4fdd\u5b58\u5e76\u9000\u51fa\u7f16\u8f91\u5668\u3002\u7136\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-shell\">python3 myscript.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5341\u4e8c\u3001\u901a\u8fc7Pyonic<\/h3>\n<\/p>\n<p><p>Pyonic\u662f\u4e00\u6b3e\u4e13\u4e3a\u5b89\u5353\u8bbe\u5907\u8bbe\u8ba1\u7684Python IDE\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u6d01\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u548c\u8fd0\u884c\u73af\u5883\uff0c\u65b9\u4fbf\u7528\u6237\u5728\u624b\u673a\u4e0a\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5Pyonic<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Pyonic\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Pyonic\u5e94\u7528\u3002<\/li>\n<\/p>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Pyonic\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002Pyonic\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7b80\u6d01\u7684\u7528\u6237\u754c\u9762\uff0c\u65b9\u4fbf\u7528\u6237\u5728\u624b\u673a\u4e0a\u8fdb\u884c\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e09\u3001\u901a\u8fc7AIDE<\/h3>\n<\/p>\n<p><p>AIDE\u662f\u4e00\u6b3e\u5f3a\u5927\u7684\u5b89\u5353\u5f00\u53d1\u5de5\u5177\uff0c\u652f\u6301Java\u3001C++\u3001Python\u7b49\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u3002\u60a8\u53ef\u4ee5\u5728AIDE\u4e2d\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5AIDE<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22AIDE\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00AIDE\u5e94\u7528\u3002<\/li>\n<\/p>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728AIDE\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\u5373\u53ef\u6267\u884c\u4ee3\u7801\u3002AIDE\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u4e30\u5bcc\u7684\u7528\u6237\u754c\u9762\uff0c\u9002\u5408\u9ad8\u7ea7\u7528\u6237\u8fdb\u884c\u590d\u6742\u7684\u7f16\u7a0b\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u56db\u3001\u901a\u8fc7Kivy Launcher<\/h3>\n<\/p>\n<p><p>Kivy Launcher\u662f\u4e00\u6b3e\u4e13\u4e3aKivy\u5e94\u7528\u8bbe\u8ba1\u7684\u542f\u52a8\u5668\uff0c\u5141\u8bb8\u7528\u6237\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884cKivy\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>\u5b89\u88c5Kivy Launcher<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Kivy Launcher\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u9700\u8981\u5c06Kivy\u5e94\u7528\u7a0b\u5e8f\u7684\u4ee3\u7801\u6587\u4ef6\u653e\u7f6e\u5728\u6307\u5b9a\u7684\u76ee\u5f55\u4e2d\u3002<\/li>\n<\/p>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u7f16\u5199Kivy\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684Kivy\u5e94\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from kivy.app import App<\/p>\n<p>from kivy.uix.label import Label<\/p>\n<p>class MyApp(App):<\/p>\n<p>    def build(self):<\/p>\n<p>        return Label(text=&#39;Hello, Kivy!&#39;)<\/p>\n<p>if __name__ == &#39;__main__&#39;:<\/p>\n<p>    MyApp().run()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5c06\u4ee3\u7801\u6587\u4ef6\u4fdd\u5b58\u4e3a<code>main.py<\/code>\uff0c\u5e76\u653e\u7f6e\u5728Kivy Launcher\u7684\u9879\u76ee\u76ee\u5f55\u4e2d\u3002\u6253\u5f00Kivy Launcher\u5e94\u7528\uff0c\u9009\u62e9\u60a8\u7684\u9879\u76ee\uff0c\u5373\u53ef\u8fd0\u884cKivy\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e94\u3001\u901a\u8fc7Pydroid 3\u548cKivy<\/h3>\n<\/p>\n<p><p>Pydroid 3\u4e0d\u4ec5\u652f\u6301\u666e\u901a\u7684Python\u5f00\u53d1\uff0c\u8fd8\u652f\u6301Kivy\u5e94\u7528\u5f00\u53d1\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528Pydroid 3\u7f16\u5199\u548c\u8fd0\u884cKivy\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><p>1\u3001<strong>\u5b89\u88c5\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5b89\u88c5Pydroid 3<\/strong>\uff1a<\/p>\n<p>\u5728Google Play\u5546\u5e97\u4e2d\u641c\u7d22Pydroid 3\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00Pydroid 3\u5e94\u7528\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b89\u88c5Kivy<\/strong>\uff1a<\/p>\n<p>\u5728Pydroid 3\u4e2d\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u83dc\u5355\u6309\u94ae\uff0c\u9009\u62e9\u201cPip\u201d\uff0c\u7136\u540e\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u8f93\u5165<code>kivy<\/code>\uff0c\u70b9\u51fb\u201cInstall\u201d\u5373\u53ef\u5b89\u88c5Kivy\u5e93\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p>2\u3001<strong>\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u5728Pydroid 3\u7684\u7f16\u8f91\u5668\u4e2d\u7f16\u5199Kivy\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from kivy.app import App<\/p>\n<p>from kivy.uix.label import Label<\/p>\n<p>class MyApp(App):<\/p>\n<p>    def build(self):<\/p>\n<p>        return Label(text=&#39;Hello, Kivy!&#39;)<\/p>\n<p>if __name__ == &#39;__main__&#39;:<\/p>\n<p>    MyApp().run()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0c\u5373\u53ef\u6267\u884c\u4ee3\u7801\u5e76\u8fd0\u884cKivy\u5e94\u7528\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u591a\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5e76\u8fdb\u884c\u5404\u79cd\u7c7b\u578b\u7684\u7f16\u7a0b\u548c\u5f00\u53d1\u4efb\u52a1\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u811a\u672c\u7f16\u5199\uff0c\u8fd8\u662f\u590d\u6742\u7684\u5e94\u7528\u5f00\u53d1\uff0c\u8fd9\u4e9b\u5de5\u5177\u548c\u65b9\u6cd5\u90fd\u80fd\u6ee1\u8db3\u60a8\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5b89\u5353\u8bbe\u5907\u4e0a\u53ef\u4ee5\u8fd0\u884cPython\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u4ec0\u4e48\uff1f<\/strong><br \/>\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u4f7f\u7528\u652f\u6301Python\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5982Pydroid 3\u3001QPython\u6216Termux\u3002\u8fd9\u4e9b\u5e94\u7528\u7a0b\u5e8f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u4f7f\u7528\u6237\u80fd\u591f\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\uff0c\u65b9\u4fbf\u8fdb\u884c\u5b66\u4e60\u548c\u5f00\u53d1\u3002<\/p>\n<p><strong>\u5728\u5b89\u5353\u4e0a\u8fd0\u884cPython\u4ee3\u7801\u9700\u8981\u5b89\u88c5\u4ec0\u4e48\u5de5\u5177\uff1f<\/strong><br \/>\u4e3a\u4e86\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u4ee3\u7801\uff0c\u60a8\u9700\u8981\u4e0b\u8f7d\u5e76\u5b89\u88c5\u4e00\u4e2aPython\u89e3\u91ca\u5668\u5e94\u7528\uff0c\u4f8b\u5982Pydroid 3\u6216QPython\u3002\u8fd9\u4e9b\u5e94\u7528\u901a\u5e38\u5305\u542bPython\u89e3\u91ca\u5668\u3001\u5e93\u548c\u4e00\u4e9b\u989d\u5916\u7684\u5de5\u5177\uff0c\u4f7f\u5f97\u7f16\u5199\u548c\u6d4b\u8bd5\u4ee3\u7801\u53d8\u5f97\u66f4\u52a0\u7b80\u5355\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728\u5b89\u5353\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\uff1f<\/strong><br \/>\u5728\u5b89\u5353\u8bbe\u5907\u4e2d\u8c03\u8bd5Python\u4ee3\u7801\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528IDE\u63d0\u4f9b\u7684\u8c03\u8bd5\u5de5\u5177\u6216\u6253\u5370\u8bed\u53e5\u6765\u5b9e\u73b0\u3002\u5927\u591a\u6570Python\u89e3\u91ca\u5668\u5e94\u7528\u90fd\u63d0\u4f9b\u4e86\u8c03\u8bd5\u529f\u80fd\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3001\u76d1\u63a7\u53d8\u91cf\u548c\u9010\u6b65\u6267\u884c\u4ee3\u7801\u3002\u6b64\u5916\uff0c\u4f7f\u7528<code>print()<\/code>\u8bed\u53e5\u8f93\u51fa\u53d8\u91cf\u7684\u503c\u4e5f\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u8c03\u8bd5\u65b9\u5f0f\u3002<\/p>\n<p><strong>\u5b89\u5353\u4e0a\u8fd0\u884cPython\u7684\u6027\u80fd\u5982\u4f55\uff1f<\/strong><br \/>\u5728\u5b89\u5353\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u7684\u6027\u80fd\u53d7\u5230\u8bbe\u5907\u786c\u4ef6\u548c\u6240\u4f7f\u7528\u7684Python\u89e3\u91ca\u5668\u7684\u5f71\u54cd\u3002\u867d\u7136\u5927\u591a\u6570\u7b80\u5355\u7684Python\u811a\u672c\u80fd\u591f\u987a\u5229\u6267\u884c\uff0c\u4f46\u5bf9\u4e8e\u8ba1\u7b97\u5bc6\u96c6\u578b\u7684\u4efb\u52a1\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u6027\u80fd\u74f6\u9888\u3002\u4f18\u5316\u4ee3\u7801\u548c\u5408\u7406\u9009\u62e9\u5e93\u53ef\u4ee5\u5e2e\u52a9\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b89\u5353\u7cfb\u7edf\u8fd0\u884cPython\u7684\u65b9\u5f0f\u6709\u5f88\u591a\u79cd\uff0c\u4e3b\u8981\u5305\u62ec\uff1a\u4f7f\u7528Python\u89e3\u91ca\u5668\u5e94\u7528\u3001\u501f\u52a9Termux\u3001\u901a\u8fc7QPyth [&hellip;]","protected":false},"author":3,"featured_media":1168140,"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\/1168127"}],"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=1168127"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168127\/revisions"}],"predecessor-version":[{"id":1168141,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1168127\/revisions\/1168141"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1168140"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1168127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1168127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1168127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}