{"id":987782,"date":"2024-12-27T07:56:26","date_gmt":"2024-12-26T23:56:26","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/987782.html"},"modified":"2024-12-27T07:56:28","modified_gmt":"2024-12-26T23:56:28","slug":"python-3%e5%a6%82%e4%bd%95%e9%85%8d%e7%bd%aegeany","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/987782.html","title":{"rendered":"python 3\u5982\u4f55\u914d\u7f6egeany"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25063731\/d3ce9e2e-845b-4f10-bc8e-adf123fc1ced.webp\" alt=\"python 3\u5982\u4f55\u914d\u7f6egeany\" \/><\/p>\n<p><p> <strong>Python 3\u5728Geany\u4e2d\u7684\u914d\u7f6e\u6d89\u53ca\u5230\u591a\u4e2a\u6b65\u9aa4\uff0c\u5305\u62ec\u5b89\u88c5Python 3\u3001\u914d\u7f6eGeany\u7684\u7f16\u8bd1\u548c\u8fd0\u884c\u547d\u4ee4\u3001\u5b89\u88c5\u76f8\u5173\u63d2\u4ef6\u3001\u4ee5\u53ca\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u7b49\u3002\u786e\u4fdd\u4f60\u5df2\u5b89\u88c5Python 3\u3001\u914d\u7f6eGeany\u7684\u7f16\u8bd1\u548c\u8fd0\u884c\u547d\u4ee4\u3001\u8c03\u6574Geany\u7684\u5916\u89c2\u548c\u884c\u4e3a\u3001\u5b89\u88c5\u63d2\u4ef6\u548c\u6269\u5c55\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u8fd9\u4e9b\u6b65\u9aa4\u5c06\u4f7f\u4f60\u80fd\u591f\u5728Geany\u4e2d\u987a\u5229\u8fdb\u884cPython 3\u7684\u5f00\u53d1\u3002<\/strong> \u4e0b\u9762\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6bcf\u4e2a\u6b65\u9aa4\u4e2d\u7684\u5173\u952e\u70b9\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u5b89\u88c5PYTHON 3<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u914d\u7f6eGeany\u4e4b\u524d\uff0c\u786e\u4fdd\u5df2\u7ecf\u5728\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u4e86Python 3\u3002\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff0c\u53ef\u4ee5\u8bbf\u95eePython\u7684\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/downloads\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E9%80%82%E5%90%88%E4%BD%A0%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%E5%AE%8C%E6%88%90%E5%90%8E%EF%BC%8C%E5%9C%A8%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%BE%93%E5%85%A5%60python3\">https:\/\/www.python.org\/downloads\/\uff09\u4e0b\u8f7d\u9002\u5408\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u7248\u672c\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5728\u547d\u4ee4\u884c\u8f93\u5165`python3<\/a> &#8211;version<code>\u6216<\/code>python &#8211;version`\u6765\u68c0\u67e5\u5b89\u88c5\u662f\u5426\u6210\u529f\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u914d\u7f6eGEANY\u7684\u7f16\u8bd1\u548c\u8fd0\u884c\u547d\u4ee4<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6253\u5f00Geany\u5e76\u521b\u5efa\u65b0\u6587\u4ef6<\/strong><br \/>\u6253\u5f00Geany\u540e\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u547d\u540d\u4e3a<code>hello.py<\/code>\u3002\u5728\u6587\u4ef6\u4e2d\u8f93\u5165\u7b80\u5355\u7684Python\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u7f16\u8bd1\u547d\u4ee4<\/strong><br \/>\u5728Geany\u4e2d\uff0c\u70b9\u51fb\u201c\u6784\u5efa\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201c\u8bbe\u7f6e\u6784\u5efa\u547d\u4ee4\u201d\u3002\u5728\u201c\u7f16\u8bd1\u201d\u9009\u9879\u4e2d\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165\u4e00\u4e2a\u547d\u4ee4\u6765\u68c0\u67e5Python\u8bed\u6cd5\uff0c\u8fd9\u91cc\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 -m py_compile &quot;%f&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8bbe\u7f6e\u8fd0\u884c\u547d\u4ee4<\/strong><br \/>\u5728\u540c\u4e00\u4e2a\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u201c\u6267\u884c\u201d\u9009\u9879\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u8fd0\u884cPython\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python3 &quot;%f&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u4e9b\u8bbe\u7f6e\u5c06\u5141\u8bb8\u4f60\u5728Geany\u4e2d\u7f16\u5199\u3001\u68c0\u67e5\u548c\u8fd0\u884cPython 3\u4ee3\u7801\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e09\u3001\u8c03\u6574GEANY\u7684\u5916\u89c2\u548c\u884c\u4e3a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u8bbe\u7f6e\u8bed\u6cd5\u9ad8\u4eae<\/strong><br \/>\u786e\u4fddGeany\u80fd\u591f\u6b63\u786e\u8bc6\u522bPython\u6587\u4ef6\u7684\u8bed\u6cd5\u3002\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201c\u9996\u9009\u9879\u201d\uff0c\u7136\u540e\u5728\u201c\u6587\u4ef6\u7c7b\u578b\u201d\u4e2d\u9009\u62e9\u201cPython\u201d\u3002\u8fd9\u5c06\u786e\u4fddPython\u4ee3\u7801\u7684\u8bed\u6cd5\u9ad8\u4eae\u6b63\u786e\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8c03\u6574\u7f29\u8fdb\u548c\u7a7a\u683c<\/strong><br \/>\u5728\u201c\u9996\u9009\u9879\u201d\u4e2d\uff0c\u9009\u62e9\u201c\u7f16\u8f91\u5668\u201d\uff0c\u7136\u540e\u8bbe\u7f6e\u7f29\u8fdb\u4e3a4\u4e2a\u7a7a\u683c\uff0c\u8fd9\u901a\u5e38\u662fPython\u4ee3\u7801\u7684\u63a8\u8350\u683c\u5f0f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u56db\u3001\u5b89\u88c5\u63d2\u4ef6\u548c\u6269\u5c55<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u63d2\u4ef6\u7ba1\u7406\u5668<\/strong><br \/>Geany\u652f\u6301\u591a\u79cd\u63d2\u4ef6\uff0c\u5e2e\u52a9\u6269\u5c55\u5176\u529f\u80fd\u3002\u53ef\u4ee5\u901a\u8fc7\u201c\u5de5\u5177\u201d\u83dc\u5355\u4e2d\u7684\u201c\u63d2\u4ef6\u7ba1\u7406\u5668\u201d\u5b89\u88c5\u548c\u542f\u7528\u6709\u7528\u7684\u63d2\u4ef6\uff0c\u4f8b\u5982\u201cGeanyPy\u201d\u63d2\u4ef6\uff0c\u8fd9\u4e2a\u63d2\u4ef6\u63d0\u4f9b\u4e86\u5bf9Python\u811a\u672c\u7684\u652f\u6301\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u4ee3\u7801\u8865\u5168\u548c\u683c\u5f0f\u5316<\/strong><br \/>\u5b89\u88c5\u5408\u9002\u7684\u63d2\u4ef6\u4ee5\u652f\u6301\u4ee3\u7801\u8865\u5168\u548c\u683c\u5f0f\u5316\u529f\u80fd\u3002\u63d2\u4ef6\u5982\u201cGeanyGenDoc\u201d\u53ef\u4ee5\u5e2e\u52a9\u751f\u6210\u6587\u6863\u5b57\u7b26\u4e32\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u4e94\u3001\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u914d\u7f6ePYTHONPATH<\/strong><br \/>\u5728\u6709\u591a\u4e2aPython\u7248\u672c\u7684\u7cfb\u7edf\u4e0a\uff0c\u6216\u8005\u9700\u8981\u4f7f\u7528\u7279\u5b9a\u7684\u5e93\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u8bbe\u7f6e<code>PYTHONPATH<\/code>\u3002\u5728\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u8bbe\u7f6e<code>PYTHONPATH<\/code>\u4ee5\u5305\u542b\u4f60\u9879\u76ee\u6240\u9700\u7684\u5e93\u8def\u5f84\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5728Geany\u4e2d\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><br \/>\u6709\u65f6\u9700\u8981\u5728Geany\u4e2d\u8bbe\u7f6e\u7279\u5b9a\u7684\u73af\u5883\u53d8\u91cf\u4ee5\u786e\u4fdd\u811a\u672c\u6b63\u786e\u8fd0\u884c\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u201c\u6784\u5efa\u201d\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u201d\u6765\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728Geany\u4e2d\u987a\u5229\u5730\u5f00\u53d1Python 3\u9879\u76ee\u3002\u8fd9\u4e9b\u914d\u7f6e\u5c06\u5e2e\u52a9\u4f60\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u5e76\u786e\u4fdd\u4f60\u7684Python\u4ee3\u7801\u5728Geany\u4e2d\u8fd0\u884c\u987a\u7545\u3002\u5982\u679c\u9700\u8981\u8fdb\u4e00\u6b65\u7684\u5b9a\u5236\uff0c\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u9700\u6c42\u8c03\u6574Geany\u7684\u8bbe\u7f6e\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Geany\u4e2d\u8bbe\u7f6ePython 3\u7684\u89e3\u91ca\u5668\u8def\u5f84\uff1f<\/strong><br \/>\u8981\u5728Geany\u4e2d\u914d\u7f6ePython 3\uff0c\u60a8\u9700\u8981\u786e\u4fdd\u6307\u5b9a\u6b63\u786e\u7684Python\u89e3\u91ca\u5668\u8def\u5f84\u3002\u6253\u5f00Geany\uff0c\u524d\u5f80\u201c\u7f16\u8f91\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201c\u9996\u9009\u9879\u201d\uff0c\u7136\u540e\u8fdb\u5165\u201c\u6784\u5efa\u201d\u9009\u9879\u5361\u3002\u5728\u201c\u547d\u4ee4\u201d\u90e8\u5206\u627e\u5230\u201c\u7f16\u8bd1\u5668\u201d\u4e0b\u62c9\u83dc\u5355\uff0c\u9009\u62e9\u201cPython\u201d\uff0c\u5e76\u5728\u76f8\u5e94\u7684\u5b57\u6bb5\u4e2d\u8f93\u5165Python 3\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u4f8b\u5982<code>\/usr\/bin\/python3<\/code>\u6216<code>C:\\Python39\\python.exe<\/code>\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Geany\u4e2d\u8fd0\u884cPython 3\u7a0b\u5e8f\uff1f<\/strong><br \/>\u8981\u8fd0\u884cPython 3\u7a0b\u5e8f\uff0c\u9996\u5148\u786e\u4fdd\u60a8\u7684\u4ee3\u7801\u5df2\u7ecf\u4fdd\u5b58\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u70b9\u51fb\u5de5\u5177\u680f\u4e0a\u7684\u8fd0\u884c\u6309\u94ae\u6216\u6309\u4e0bF5\u6765\u6267\u884c\u4ee3\u7801\u3002\u5982\u679cGeany\u5df2\u6b63\u786e\u914d\u7f6ePython 3\uff0c\u7a0b\u5e8f\u5c06\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u663e\u793a\u8f93\u51fa\u3002\u82e5\u9047\u5230\u4efb\u4f55\u95ee\u9898\uff0c\u8bf7\u68c0\u67e5\u60a8\u7684\u4ee3\u7801\u662f\u5426\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\uff0c\u4ee5\u53caPython\u89e3\u91ca\u5668\u7684\u8def\u5f84\u662f\u5426\u914d\u7f6e\u6b63\u786e\u3002<\/p>\n<p><strong>\u5728Geany\u4e2d\u5982\u4f55\u8c03\u8bd5Python 3\u4ee3\u7801\uff1f<\/strong><br \/>Geany\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u8c03\u8bd5\u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u65ad\u70b9\u548c\u4f7f\u7528\u8c03\u8bd5\u63a7\u5236\u6765\u5e2e\u52a9\u60a8\u6392\u67e5\u9519\u8bef\u3002\u60a8\u53ef\u4ee5\u5728\u4ee3\u7801\u884c\u53f7\u65c1\u8fb9\u5355\u51fb\u4ee5\u8bbe\u7f6e\u6216\u5220\u9664\u65ad\u70b9\u3002\u7136\u540e\uff0c\u901a\u8fc7\u83dc\u5355\u4e2d\u7684\u201c\u8c03\u8bd5\u201d\u9009\u9879\u6765\u542f\u52a8\u8c03\u8bd5\u4f1a\u8bdd\u3002\u8bf7\u6ce8\u610f\uff0c\u8c03\u8bd5\u529f\u80fd\u53ef\u80fd\u9700\u8981\u60a8\u5b89\u88c5\u989d\u5916\u7684\u8c03\u8bd5\u5668\u63d2\u4ef6\uff0c\u786e\u4fdd\u60a8\u5df2\u7ecf\u6309\u7167Geany\u7684\u76f8\u5173\u6587\u6863\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<p><strong>\u5982\u4f55\u63d0\u9ad8\u5728Geany\u4e2d\u7f16\u5199Python 3\u4ee3\u7801\u7684\u6548\u7387\uff1f<\/strong><br \/>\u4e3a\u4e86\u63d0\u9ad8\u6548\u7387\uff0c\u60a8\u53ef\u4ee5\u5229\u7528Geany\u7684\u4ee3\u7801\u7247\u6bb5\u529f\u80fd\u3002\u901a\u8fc7\u201c\u7f16\u8f91\u201d\u83dc\u5355\u4e2d\u7684\u201c\u4ee3\u7801\u7247\u6bb5\u201d\u9009\u9879\uff0c\u53ef\u4ee5\u521b\u5efa\u5e38\u7528\u7684\u4ee3\u7801\u5757\u4ee5\u4fbf\u5feb\u901f\u63d2\u5165\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u81ea\u52a8\u5b8c\u6210\u548c\u8bed\u6cd5\u9ad8\u4eae\u529f\u80fd\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u5feb\u5730\u7f16\u5199\u4ee3\u7801\uff0c\u5e76\u51cf\u5c11\u9519\u8bef\u3002\u5b9a\u671f\u66f4\u65b0Geany\u5230\u6700\u65b0\u7248\u672c\u4e5f\u80fd\u786e\u4fdd\u60a8\u83b7\u5f97\u6700\u4f73\u7684\u5f00\u53d1\u4f53\u9a8c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python 3\u5728Geany\u4e2d\u7684\u914d\u7f6e\u6d89\u53ca\u5230\u591a\u4e2a\u6b65\u9aa4\uff0c\u5305\u62ec\u5b89\u88c5Python 3\u3001\u914d\u7f6eGeany\u7684\u7f16\u8bd1\u548c\u8fd0\u884c\u547d\u4ee4\u3001 [&hellip;]","protected":false},"author":3,"featured_media":987786,"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\/987782"}],"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=987782"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/987782\/revisions"}],"predecessor-version":[{"id":987791,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/987782\/revisions\/987791"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/987786"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=987782"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=987782"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=987782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}