{"id":1081208,"date":"2025-01-08T12:37:29","date_gmt":"2025-01-08T04:37:29","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1081208.html"},"modified":"2025-01-08T12:37:31","modified_gmt":"2025-01-08T04:37:31","slug":"python%e8%84%9a%e6%9c%ac%e5%a6%82%e4%bd%95%e5%9c%a8%e6%89%8b%e6%9c%ba%e8%bf%90%e8%a1%8c-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1081208.html","title":{"rendered":"python\u811a\u672c\u5982\u4f55\u5728\u624b\u673a\u8fd0\u884c"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24183329\/7e01e218-2130-4203-a99e-6997cde4c5cd.webp\" alt=\"python\u811a\u672c\u5982\u4f55\u5728\u624b\u673a\u8fd0\u884c\" \/><\/p>\n<p><p> <strong>Python\u811a\u672c\u5728\u624b\u673a\u8fd0\u884c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\u3001\u4f7f\u7528Python\u5e94\u7528\u3001\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3001\u4f7f\u7528Android\u8bbe\u5907\u7684Termux\u3001\u901a\u8fc7iOS\u8bbe\u5907\u7684Pythonista\u7b49\u3002<\/strong> \u5176\u4e2d\uff0c\u4f7f\u7528\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\u548c\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u662f\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u3002\u901a\u8fc7\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\uff0c\u7528\u6237\u53ef\u4ee5\u76f4\u63a5\u5728\u624b\u673a\u4e0a\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\uff0c\u8fd9\u5bf9\u4e8e\u7b80\u5355\u7684\u811a\u672c\u548c\u5b66\u4e60\u975e\u5e38\u65b9\u4fbf\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u63d0\u4f9b\u76f8\u5173\u6b65\u9aa4\u548c\u793a\u4f8b\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668<\/p>\n<\/p>\n<p><p>\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\u662f\u4e13\u95e8\u4e3a\u624b\u673a\u8bbe\u8ba1\u7684Python\u7f16\u7a0b\u73af\u5883\uff0c\u5141\u8bb8\u7528\u6237\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u3002\u5e38\u89c1\u7684\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\u5305\u62ecQPython\u3001Pydroid 3\u548cPythonista\uff08\u9002\u7528\u4e8eiOS\u8bbe\u5907\uff09\u3002<\/p>\n<\/p>\n<p><h3>QPython<\/h3>\n<\/p>\n<p><p>QPython\u662f\u4e00\u4e2a\u9002\u7528\u4e8eAndroid\u8bbe\u5907\u7684Python\u89e3\u91ca\u5668\uff0c\u652f\u6301Python 2\u548cPython 3\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u5141\u8bb8\u7528\u6237\u7f16\u5199\u3001\u7f16\u8f91\u548c\u6267\u884cPython\u811a\u672c\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5QPython\uff1a\u5728Google Play Store\u4e2d\u641c\u7d22QPython\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u6253\u5f00QPython\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u770b\u5230\u4e00\u4e2a\u5305\u542b\u591a\u4e2a\u9009\u9879\u7684\u4e3b\u754c\u9762\u3002<\/li>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u70b9\u51fb\u201cEditor\u201d\u9009\u9879\u8fdb\u5165\u7f16\u8f91\u5668\u754c\u9762\uff0c\u5728\u8fd9\u91cc\u60a8\u53ef\u4ee5\u7f16\u5199Python\u4ee3\u7801\u3002<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u7f16\u5199\u5b8c\u6210\u540e\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cQPython\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><h3>Pydroid 3<\/h3>\n<\/p>\n<p><p>Pydroid 3\u662f\u53e6\u4e00\u4e2a\u9002\u7528\u4e8eAndroid\u8bbe\u5907\u7684Python\u89e3\u91ca\u5668\uff0c\u652f\u6301Python 3\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684IDE\uff0c\u652f\u6301\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\u548c\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Pydroid 3\uff1a\u5728Google Play Store\u4e2d\u641c\u7d22Pydroid 3\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u6253\u5f00Pydroid 3\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u8fdb\u5165\u4e00\u4e2a\u7b80\u5355\u7684\u7f16\u8f91\u5668\u754c\u9762\u3002<\/li>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\u3002<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cPydroid 3\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><h3>Pythonista<\/h3>\n<\/p>\n<p><p>Pythonista\u662f\u4e00\u4e2a\u9002\u7528\u4e8eiOS\u8bbe\u5907\u7684Python\u89e3\u91ca\u5668\uff0c\u652f\u6301Python 3\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684IDE\uff0c\u652f\u6301\u4e30\u5bcc\u7684\u5e93\u548c\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Pythonista\uff1a\u5728App Store\u4e2d\u641c\u7d22Pythonista\u5e76\u4e0b\u8f7d\u5b89\u88c5\uff08\u6ce8\u610f\uff1aPythonista\u662f\u4ed8\u8d39\u5e94\u7528\uff09\u3002<\/li>\n<li>\u6253\u5f00Pythonista\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u8fdb\u5165\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f16\u8f91\u5668\u754c\u9762\u3002<\/li>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\u3002<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cPythonista\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><p>\u4e8c\u3001\u4f7f\u7528Python\u5e94\u7528<\/p>\n<\/p>\n<p><p>\u9664\u4e86\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\u5916\uff0c\u8fd8\u6709\u4e00\u4e9b\u4e13\u95e8\u4e3a\u624b\u673a\u8bbe\u8ba1\u7684Python\u5e94\u7528\uff0c\u8fd9\u4e9b\u5e94\u7528\u901a\u5e38\u96c6\u6210\u4e86Python\u89e3\u91ca\u5668\u548cIDE\uff0c\u63d0\u4f9b\u4e86\u4fbf\u6377\u7684\u7f16\u7a0b\u73af\u5883\u3002<\/p>\n<\/p>\n<p><h3>Pyto<\/h3>\n<\/p>\n<p><p>Pyto\u662f\u4e00\u4e2a\u9002\u7528\u4e8eiOS\u8bbe\u5907\u7684Python\u5e94\u7528\uff0c\u652f\u6301Python 3\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684IDE\uff0c\u652f\u6301\u591a\u79cd\u7b2c\u4e09\u65b9\u5e93\u548c\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Pyto\uff1a\u5728App Store\u4e2d\u641c\u7d22Pyto\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u6253\u5f00Pyto\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u8fdb\u5165\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f16\u8f91\u5668\u754c\u9762\u3002<\/li>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\u3002<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cPyto\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><h3>Termux<\/h3>\n<\/p>\n<p><p>Termux\u662f\u4e00\u4e2a\u9002\u7528\u4e8eAndroid\u8bbe\u5907\u7684\u7ec8\u7aef\u6a21\u62df\u5668\u548cLinux\u73af\u5883\uff0c\u652f\u6301\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002\u901a\u8fc7Termux\uff0c\u7528\u6237\u53ef\u4ee5\u5728Android\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u811a\u672c\uff0c\u5e76\u5b89\u88c5\u548c\u4f7f\u7528\u5404\u79cdPython\u5e93\u548c\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Termux\uff1a\u5728Google Play Store\u4e2d\u641c\u7d22Termux\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u6253\u5f00Termux\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u8fdb\u5165\u4e00\u4e2a\u7ec8\u7aef\u754c\u9762\u3002<\/li>\n<li>\u5b89\u88c5Python\uff1a\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\uff1a\n<pre><code>pkg install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u4f7f\u7528Termux\u5185\u7f6e\u7684\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982nano\uff09\u7f16\u5199Python\u811a\u672c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u5e76\u7f16\u8f91\u4e00\u4e2a\u540d\u4e3a<code>script.py<\/code>\u7684\u6587\u4ef6\uff1a\n<pre><code>nano script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u6309<code>Ctrl + X<\/code>\u9000\u51fa\u5e76\u4fdd\u5b58\u6587\u4ef6\u3002<\/li>\n<\/p>\n<li>\u6267\u884c\u811a\u672c\uff1a\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6267\u884cPython\u811a\u672c\uff1a\n<pre><code>python script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668<\/p>\n<\/p>\n<p><p>\u53e6\u4e00\u79cd\u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u811a\u672c\u7684\u65b9\u6cd5\u662f\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u9700\u8981\u5728\u9ad8\u6027\u80fd\u670d\u52a1\u5668\u4e0a\u6267\u884c\u590d\u6742\u8ba1\u7b97\u6216\u9700\u8981\u8bbf\u95ee\u7279\u5b9a\u8d44\u6e90\u7684\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h3>\u4f7f\u7528JuiceSSH<\/h3>\n<\/p>\n<p><p>JuiceSSH\u662f\u4e00\u4e2a\u9002\u7528\u4e8eAndroid\u8bbe\u5907\u7684SSH\u5ba2\u6237\u7aef\uff0c\u5141\u8bb8\u7528\u6237\u901a\u8fc7SSH\u534f\u8bae\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5JuiceSSH\uff1a\u5728Google Play Store\u4e2d\u641c\u7d22JuiceSSH\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u914d\u7f6e\u8fde\u63a5\uff1a\u6253\u5f00JuiceSSH\uff0c\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c+\u201d\u6309\u94ae\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u8fde\u63a5\u3002\u8f93\u5165\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216IP\u5730\u5740\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u6216\u79c1\u94a5\u3002<\/li>\n<li>\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff1a\u70b9\u51fb\u914d\u7f6e\u597d\u7684\u8fde\u63a5\uff0cJuiceSSH\u5c06\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/li>\n<li>\u7f16\u5199\u548c\u6267\u884c\u811a\u672c\uff1a\u5728SSH\u7ec8\u7aef\u4e2d\uff0c\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982nano\u6216vim\uff09\u7f16\u5199Python\u811a\u672c\uff0c\u7136\u540e\u4f7f\u7528Python\u89e3\u91ca\u5668\u6267\u884c\u811a\u672c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u5e76\u7f16\u8f91\u4e00\u4e2a\u540d\u4e3a<code>script.py<\/code>\u7684\u6587\u4ef6\uff1a\n<pre><code>nano script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u6309<code>Ctrl + X<\/code>\u9000\u51fa\u5e76\u4fdd\u5b58\u6587\u4ef6\u3002\u63a5\u7740\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6267\u884cPython\u811a\u672c\uff1a<\/p>\n<pre><code>python script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4f7f\u7528Termius<\/h3>\n<\/p>\n<p><p>Termius\u662f\u53e6\u4e00\u4e2a\u9002\u7528\u4e8eiOS\u548cAndroid\u8bbe\u5907\u7684SSH\u5ba2\u6237\u7aef\uff0c\u529f\u80fd\u5f3a\u5927\u4e14\u6613\u4e8e\u4f7f\u7528\u3002<\/p>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Termius\uff1a\u5728App Store\u6216Google Play Store\u4e2d\u641c\u7d22Termius\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u914d\u7f6e\u8fde\u63a5\uff1a\u6253\u5f00Termius\uff0c\u70b9\u51fb\u53f3\u4e0b\u89d2\u7684\u201cHosts\u201d\u9009\u9879\u5361\uff0c\u7136\u540e\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c+\u201d\u6309\u94ae\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u8fde\u63a5\u3002\u8f93\u5165\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216IP\u5730\u5740\u3001\u7528\u6237\u540d\u548c\u5bc6\u7801\u6216\u79c1\u94a5\u3002<\/li>\n<li>\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff1a\u70b9\u51fb\u914d\u7f6e\u597d\u7684\u8fde\u63a5\uff0cTermius\u5c06\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/li>\n<li>\u7f16\u5199\u548c\u6267\u884c\u811a\u672c\uff1a\u5728SSH\u7ec8\u7aef\u4e2d\uff0c\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982nano\u6216vim\uff09\u7f16\u5199Python\u811a\u672c\uff0c\u7136\u540e\u4f7f\u7528Python\u89e3\u91ca\u5668\u6267\u884c\u811a\u672c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u5e76\u7f16\u8f91\u4e00\u4e2a\u540d\u4e3a<code>script.py<\/code>\u7684\u6587\u4ef6\uff1a\n<pre><code>nano script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u6309<code>Ctrl + X<\/code>\u9000\u51fa\u5e76\u4fdd\u5b58\u6587\u4ef6\u3002\u63a5\u7740\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6267\u884cPython\u811a\u672c\uff1a<\/p>\n<pre><code>python script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u901a\u8fc7Android\u8bbe\u5907\u7684Termux<\/p>\n<\/p>\n<p><p>Termux\u4e0d\u4ec5\u53ef\u4ee5\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u8fd8\u53ef\u4ee5\u5728\u672c\u5730\u5b89\u88c5\u548c\u8fd0\u884cPython\u89e3\u91ca\u5668\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Termux\u5728Android\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u811a\u672c\u7684\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u5b89\u88c5\u548c\u914d\u7f6eTermux<\/h3>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Termux\uff1a\u5728Google Play Store\u4e2d\u641c\u7d22Termux\u5e76\u4e0b\u8f7d\u5b89\u88c5\u3002<\/li>\n<li>\u6253\u5f00Termux\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u8fdb\u5165\u4e00\u4e2a\u7ec8\u7aef\u754c\u9762\u3002<\/li>\n<li>\u66f4\u65b0\u5305\u7ba1\u7406\u5668\uff1a\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u5305\u7ba1\u7406\u5668\uff1a\n<pre><code>pkg update<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5b89\u88c5Python\uff1a\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5Python\uff1a\n<pre><code>pkg install python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u7f16\u5199\u548c\u6267\u884cPython\u811a\u672c<\/h3>\n<\/p>\n<ol>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u4f7f\u7528Termux\u5185\u7f6e\u7684\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982nano\uff09\u7f16\u5199Python\u811a\u672c\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u5e76\u7f16\u8f91\u4e00\u4e2a\u540d\u4e3a<code>script.py<\/code>\u7684\u6587\u4ef6\uff1a\n<pre><code>nano script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\uff0c\u7136\u540e\u6309<code>Ctrl + X<\/code>\u9000\u51fa\u5e76\u4fdd\u5b58\u6587\u4ef6\u3002<\/li>\n<\/p>\n<li>\u6267\u884c\u811a\u672c\uff1a\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6267\u884cPython\u811a\u672c\uff1a\n<pre><code>python script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u5b89\u88c5\u548c\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/h3>\n<\/p>\n<p><p>Termux\u652f\u6301\u5b89\u88c5\u548c\u4f7f\u7528\u5404\u79cdPython\u5e93\u548c\u6a21\u5757\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u548c\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u7684\u793a\u4f8b\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5pip\uff1a\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5pip\uff08Python\u5305\u7ba1\u7406\u5668\uff09\uff1a\n<pre><code>pkg install python-pip<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\uff1a\u4f7f\u7528pip\u5b89\u88c5\u6240\u9700\u7684Python\u5e93\u3002\u4f8b\u5982\uff0c\u5b89\u88c5requests\u5e93\uff1a\n<pre><code>pip install requests<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\uff1a\u5728Python\u811a\u672c\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528\u5b89\u88c5\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n<pre><code class=\"language-python\">import requests<\/p>\n<p>response = requests.get(&#39;https:\/\/api.github.com&#39;)<\/p>\n<p>print(response.json())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p>\u7136\u540e\uff0c\u5728Termux\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6267\u884c\u811a\u672c\uff1a<\/p>\n<pre><code>python example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u901a\u8fc7iOS\u8bbe\u5907\u7684Pythonista<\/p>\n<\/p>\n<p><p>Pythonista\u662f\u4e00\u4e2a\u9002\u7528\u4e8eiOS\u8bbe\u5907\u7684Python\u89e3\u91ca\u5668\uff0c\u652f\u6301Python 3\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5f3a\u5927\u7684IDE\uff0c\u652f\u6301\u4e30\u5bcc\u7684\u5e93\u548c\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><h3>\u5b89\u88c5\u548c\u914d\u7f6ePythonista<\/h3>\n<\/p>\n<ol>\n<li>\u4e0b\u8f7d\u5e76\u5b89\u88c5Pythonista\uff1a\u5728App Store\u4e2d\u641c\u7d22Pythonista\u5e76\u4e0b\u8f7d\u5b89\u88c5\uff08\u6ce8\u610f\uff1aPythonista\u662f\u4ed8\u8d39\u5e94\u7528\uff09\u3002<\/li>\n<li>\u6253\u5f00Pythonista\uff1a\u542f\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u60a8\u5c06\u8fdb\u5165\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u7f16\u8f91\u5668\u754c\u9762\u3002<\/li>\n<\/ol>\n<p><h3>\u7f16\u5199\u548c\u6267\u884cPython\u811a\u672c<\/h3>\n<\/p>\n<ol>\n<li>\u7f16\u5199\u811a\u672c\uff1a\u5728\u7f16\u8f91\u5668\u4e2d\u8f93\u5165Python\u4ee3\u7801\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>script.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n<pre><code class=\"language-python\">print(&quot;Hello, Pythonista!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cPythonista\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><h3>\u5b89\u88c5\u548c\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93<\/h3>\n<\/p>\n<p><p>Pythonista\u652f\u6301\u5b89\u88c5\u548c\u4f7f\u7528\u5404\u79cdPython\u5e93\u548c\u6a21\u5757\u3002\u4ee5\u4e0b\u662f\u5b89\u88c5\u548c\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\u7684\u793a\u4f8b\u3002<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5\u7b2c\u4e09\u65b9\u5e93\uff1a\u5728Pythonista\u4e2d\uff0c\u6253\u5f00\u201c\u5e93\u7ba1\u7406\u5668\u201d\u5e76\u641c\u7d22\u6240\u9700\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u5b89\u88c5requests\u5e93\u3002<\/li>\n<li>\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93\uff1a\u5728Python\u811a\u672c\u4e2d\u5bfc\u5165\u5e76\u4f7f\u7528\u5b89\u88c5\u7684\u5e93\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n<pre><code class=\"language-python\">import requests<\/p>\n<p>response = requests.get(&#39;https:\/\/api.github.com&#39;)<\/p>\n<p>print(response.json())<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cPythonista\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<\/ol>\n<p><h3>\u4f7f\u7528Pythonista\u7684\u5185\u7f6e\u529f\u80fd<\/h3>\n<\/p>\n<p><p>Pythonista\u4e0d\u4ec5\u652f\u6301\u6807\u51c6\u7684Python\u5e93\uff0c\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u72ec\u7279\u7684\u5185\u7f6e\u529f\u80fd\uff0c\u5982\u8bbf\u95ee\u8bbe\u5907\u76f8\u673a\u3001\u76f8\u518c\u3001\u526a\u8d34\u677f\u7b49\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Pythonista\u5185\u7f6e\u529f\u80fd\u7684\u793a\u4f8b\u3002<\/p>\n<\/p>\n<ol>\n<li>\u8bbf\u95ee\u8bbe\u5907\u76f8\u673a\uff1a\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>camera.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u5728\u5176\u4e2d\u7f16\u5199\u4ee5\u4e0b\u4ee3\u7801\uff1a\n<pre><code class=\"language-python\">import photos<\/p>\n<h2><strong>\u62cd\u6444\u7167\u7247<\/strong><\/h2>\n<p>photo = photos.capture_image()<\/p>\n<p>if photo:<\/p>\n<p>    # \u5c06\u7167\u7247\u4fdd\u5b58\u5230\u76f8\u518c<\/p>\n<p>    photos.save_image(photo)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u6267\u884c\u811a\u672c\uff1a\u70b9\u51fb\u53f3\u4e0a\u89d2\u7684\u201c\u8fd0\u884c\u201d\u6309\u94ae\uff0cPythonista\u5c06\u81ea\u52a8\u6267\u884c\u811a\u672c\uff0c\u5e76\u6253\u5f00\u8bbe\u5907\u76f8\u673a\u62cd\u6444\u7167\u7247\u3002<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u8fd0\u884cPython\u811a\u672c\u3002\u8fd9\u4e9b\u65b9\u6cd5\u4e0d\u4ec5\u65b9\u4fbf\u4e86Python\u7f16\u7a0b\u7684\u5b66\u4e60\u548c\u5b9e\u8df5\uff0c\u8fd8\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u529f\u80fd\u548c\u7075\u6d3b\u6027\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u811a\u672c\u8fd8\u662f\u590d\u6742\u7684\u9879\u76ee\uff0c\u60a8\u90fd\u53ef\u4ee5\u5728\u624b\u673a\u4e0a\u8f7b\u677e\u5730\u8fdb\u884c\u7f16\u5199\u548c\u6267\u884c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>1. \u5982\u4f55\u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u811a\u672c\uff1f<\/strong><br \/>\u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u811a\u672c\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4e0b\u8f7d\u4e13\u95e8\u7684Python\u7f16\u7a0b\u5e94\u7528\uff0c\u5982Pydroid 3\uff08\u9002\u7528\u4e8eAndroid\uff09\u6216Pythonista\uff08\u9002\u7528\u4e8eiOS\uff09\u3002\u8fd9\u4e9b\u5e94\u7528\u63d0\u4f9b\u4e86\u4e00\u4e2a\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u5176\u4e2d\u7f16\u5199\u3001\u7f16\u8f91\u548c\u8fd0\u884cPython\u4ee3\u7801\u3002\u7528\u6237\u53ea\u9700\u5728\u5e94\u7528\u4e2d\u8f93\u5165\u4ee3\u7801\u5e76\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\uff0c\u5373\u53ef\u770b\u5230\u8f93\u51fa\u7ed3\u679c\u3002<\/p>\n<p><strong>2. \u624b\u673a\u4e0a\u662f\u5426\u6709\u9002\u5408Python\u5f00\u53d1\u7684IDE\u63a8\u8350\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u624b\u673a\u4e0a\u6709\u591a\u6b3e\u9002\u5408Python\u5f00\u53d1\u7684IDE\u3002\u5bf9\u4e8eAndroid\u7528\u6237\uff0cPydroid 3\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u9009\u62e9\uff0c\u5b83\u652f\u6301\u591a\u79cdPython\u5e93\u548c\u6a21\u5757\uff0c\u975e\u5e38\u9002\u5408\u521d\u5b66\u8005\u548c\u7ecf\u9a8c\u4e30\u5bcc\u7684\u5f00\u53d1\u8005\u3002\u5bf9\u4e8eiOS\u7528\u6237\uff0cPythonista\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u529f\u80fd\u548c\u53cb\u597d\u7684\u7528\u6237\u754c\u9762\uff0c\u652f\u6301\u56fe\u5f62\u754c\u9762\u7f16\u7a0b\u548c\u591a\u79cd\u5e93\u7684\u4f7f\u7528\u3002\u6b64\u5916\uff0cTermux\u4e5f\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff0c\u9002\u5408\u559c\u6b22\u547d\u4ee4\u884c\u64cd\u4f5c\u7684\u7528\u6237\u3002<\/p>\n<p><strong>3. \u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u811a\u672c\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u4e8b\u9879\uff1f<\/strong><br \/>\u5728\u624b\u673a\u4e0a\u8fd0\u884cPython\u811a\u672c\u65f6\uff0c\u7528\u6237\u9700\u8981\u6ce8\u610f\u8bbe\u5907\u6027\u80fd\u548c\u5185\u5b58\u9650\u5236\u3002\u590d\u6742\u7684\u811a\u672c\u6216\u9700\u8981\u5927\u91cf\u8d44\u6e90\u7684\u7a0b\u5e8f\u53ef\u80fd\u4f1a\u5bfc\u81f4\u624b\u673a\u8fd0\u884c\u7f13\u6162\u6216\u5d29\u6e83\u3002\u5efa\u8bae\u5728\u7f16\u5199\u811a\u672c\u65f6\u5c3d\u91cf\u7b80\u5316\u4ee3\u7801\uff0c\u5e76\u8fdb\u884c\u5145\u5206\u7684\u6d4b\u8bd5\u3002\u6b64\u5916\uff0c\u786e\u4fdd\u6240\u4f7f\u7528\u7684IDE\u652f\u6301\u6240\u9700\u7684\u5e93\u548c\u6a21\u5757\uff0c\u4ee5\u907f\u514d\u517c\u5bb9\u6027\u95ee\u9898\u3002\u6700\u540e\uff0c\u5b9a\u671f\u4fdd\u5b58\u4ee3\u7801\u548c\u6570\u636e\u4ee5\u9632\u6b62\u610f\u5916\u4e22\u5931\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u811a\u672c\u5728\u624b\u673a\u8fd0\u884c\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u79fb\u52a8\u7aefPython\u89e3\u91ca\u5668\u3001\u4f7f\u7528Python\u5e94\u7528\u3001\u901a\u8fc7SSH\u8fde\u63a5\u5230\u8fdc\u7a0b [&hellip;]","protected":false},"author":3,"featured_media":1081213,"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\/1081208"}],"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=1081208"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1081208\/revisions"}],"predecessor-version":[{"id":1081215,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1081208\/revisions\/1081215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1081213"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1081208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1081208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1081208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}