{"id":986424,"date":"2024-12-27T07:44:51","date_gmt":"2024-12-26T23:44:51","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/986424.html"},"modified":"2024-12-27T07:44:53","modified_gmt":"2024-12-26T23:44:53","slug":"%e5%a6%82%e4%bd%95python%e8%bd%ac%e4%b8%baexe%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/986424.html","title":{"rendered":"\u5982\u4f55python\u8f6c\u4e3aexe\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25063021\/d55200b0-31bf-4683-916e-0fbac537984f.webp\" alt=\"\u5982\u4f55python\u8f6c\u4e3aexe\u6587\u4ef6\" \/><\/p>\n<p><p> \u5c06Python\u811a\u672c\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff08exe\uff09\u53ef\u4ee5\u4f7f\u5176\u5728\u6ca1\u6709Python\u89e3\u91ca\u5668\u7684Windows\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002<strong>\u4f7f\u7528PyInstaller\u3001\u4f7f\u7528cx_Freeze\u3001\u4f7f\u7528Py2exe<\/strong>\u662f\u5e38\u89c1\u7684\u65b9\u6cd5\u3002\u8fd9\u91cc\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528PyInstaller\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><p><strong>PyInstaller\u7b80\u4ecb<\/strong><\/p>\n<\/p>\n<p><p>PyInstaller\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06Python\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5b83\u652f\u6301Python 3.5\u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728Windows\u3001macOS\u548cLinux\u4e0a\u8fd0\u884c\u3002PyInstaller\u4f1a\u5206\u6790Python\u7a0b\u5e8f\u7684\u4f9d\u8d56\u5173\u7cfb\uff0c\u5e76\u5c06\u6240\u6709\u5fc5\u9700\u7684\u5e93\u548c\u6587\u4ef6\u6253\u5305\u5230\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b89\u88c5PyInstaller<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u786e\u4fdd\u4f60\u7684\u8ba1\u7b97\u673a\u4e0a\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002\u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5PyInstaller\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pyinstaller<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528PyInstaller\u8f6c\u6362Python\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u65e6PyInstaller\u5b89\u88c5\u5b8c\u6210\uff0c\u4f60\u5c31\u53ef\u4ee5\u5f00\u59cb\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u4e86\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u7f16\u5199\u5e76\u6d4b\u8bd5\u4e86\u4f60\u7684Python\u811a\u672c\u3002\u5047\u8bbe\u4f60\u7684\u811a\u672c\u540d\u4e3a<code>my_script.py<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPyInstaller<\/strong><\/p>\n<\/p>\n<p><p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08cmd\uff09\u6216\u7ec8\u7aef\uff0c\u7136\u540e\u5bfc\u822a\u5230\u4f60\u7684Python\u811a\u672c\u6240\u5728\u7684\u76ee\u5f55\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyinstaller --onefile my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\u7684<code>--onefile<\/code>\u9009\u9879\u8868\u793aPyInstaller\u4f1a\u5c06\u6240\u6709\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5982\u679c\u4f60\u5e0c\u671b\u751f\u6210\u4e00\u4e2a\u76ee\u5f55\u800c\u4e0d\u662f\u5355\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u7701\u7565\u6b64\u9009\u9879\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u751f\u6210\u7684\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u5b8c\u6210\u540e\uff0cPyInstaller\u4f1a\u5728\u4f60\u7684\u811a\u672c\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>dist<\/code>\u7684\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u5305\u542b\u4e00\u4e2a\u540d\u4e3a<code>my_script.exe<\/code>\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6d4b\u8bd5\u53ef\u6267\u884c\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u53cc\u51fb<code>my_script.exe<\/code>\uff0c\u6216\u8005\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u5b83\uff0c\u786e\u4fdd\u5b83\u6309\u9884\u671f\u5de5\u4f5c\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>PyInstaller\u7684\u9ad8\u7ea7\u9009\u9879<\/strong><\/p>\n<\/p>\n<p><p>PyInstaller\u63d0\u4f9b\u4e86\u8bb8\u591a\u9009\u9879\u6765\u5b9a\u5236\u53ef\u6267\u884c\u6587\u4ef6\u7684\u751f\u6210\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u9009\u9879\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>&#8211;windowed<\/strong>\uff1a\u5bf9\u4e8eGUI\u5e94\u7528\u7a0b\u5e8f\uff0c\u4f7f\u7528\u6b64\u9009\u9879\u53ef\u4ee5\u9632\u6b62\u6253\u5f00\u63a7\u5236\u53f0\u7a97\u53e3\u3002<\/li>\n<li><strong>&#8211;icon<\/strong>\uff1a\u53ef\u4ee5\u6307\u5b9a\u56fe\u6807\u6587\u4ef6\uff08.ico\uff09\u4e3a\u751f\u6210\u7684exe\u6587\u4ef6\u3002<\/li>\n<li><strong>&#8211;add-data<\/strong>\uff1a\u7528\u4e8e\u5305\u542b\u989d\u5916\u7684\u6570\u636e\u6587\u4ef6\uff0c\u5982\u914d\u7f6e\u6587\u4ef6\u3001\u56fe\u50cf\u7b49\u3002<\/li>\n<\/ul>\n<p><p>\u4f8b\u5982\uff0c\u4ee5\u4e0b\u547d\u4ee4\u5c06Python\u811a\u672c\u6253\u5305\u6210\u4e00\u4e2a\u5e26\u6709\u56fe\u6807\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u5305\u542b\u989d\u5916\u7684\u6570\u636e\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyinstaller --onefile --windowed --icon=my_icon.ico --add-data &quot;data.txt;.&quot; my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u89e3\u51b3\u5e38\u89c1\u95ee\u9898<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528PyInstaller\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u6a21\u5757\u672a\u627e\u5230\u9519\u8bef<\/strong>\uff1a\u5982\u679c\u5728\u8fd0\u884cexe\u6587\u4ef6\u65f6\u51fa\u73b0\u6a21\u5757\u672a\u627e\u5230\u7684\u9519\u8bef\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528<code>--hidden-import<\/code>\u9009\u9879\u624b\u52a8\u6307\u5b9a\u7f3a\u5931\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pyinstaller --onefile --hidden-import=missing_module my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8def\u5f84\u95ee\u9898<\/strong>\uff1a\u5982\u679c\u4f60\u7684\u811a\u672c\u4f9d\u8d56\u4e8e\u76f8\u5bf9\u8def\u5f84\u7684\u6587\u4ef6\uff0c\u53ef\u80fd\u9700\u8981\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84\uff0c\u6216\u8005\u786e\u4fdd\u8fd9\u4e9b\u6587\u4ef6\u5728<code>--add-data<\/code>\u9009\u9879\u4e2d\u6b63\u786e\u5305\u542b\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u517c\u5bb9\u6027\u95ee\u9898<\/strong>\uff1a\u786e\u4fdd\u4f7f\u7528\u4e0e\u76ee\u6807\u7cfb\u7edf\u76f8\u540c\u7684Python\u7248\u672c\u548c\u5e93\u7248\u672c\u8fdb\u884c\u6253\u5305\u3002<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<p><p><strong>cx_Freeze\u7b80\u4ecb<\/strong><\/p>\n<\/p>\n<p><p>\u9664\u4e86PyInstaller\uff0ccx_Freeze\u4e5f\u662f\u4e00\u4e2a\u5e7f\u6cdb\u4f7f\u7528\u7684\u5de5\u5177\uff0c\u7528\u4e8e\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5b83\u4e0ePyInstaller\u7c7b\u4f3c\uff0c\u4f46\u5728\u67d0\u4e9b\u7279\u5b9a\u60c5\u51b5\u4e0b\u53ef\u80fd\u66f4\u9002\u5408\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b89\u88c5cx_Freeze<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5cx_Freeze\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install cx_Freeze<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528cx_Freeze\u8f6c\u6362Python\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4f7f\u7528cx_Freeze\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4e0ePyInstaller\u4e00\u6837\uff0c\u9996\u5148\u7f16\u5199\u5e76\u6d4b\u8bd5\u4f60\u7684Python\u811a\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199setup\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>setup.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from cx_Freeze import setup, Executable<\/p>\n<p>setup(<\/p>\n<p>    name=&quot;my_script&quot;,<\/p>\n<p>    version=&quot;1.0&quot;,<\/p>\n<p>    description=&quot;My Python script&quot;,<\/p>\n<p>    executables=[Executable(&quot;my_script.py&quot;)]<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884ccx_Freeze<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230<code>setup.py<\/code>\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python setup.py build<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u751f\u6210\u7684\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>cx_Freeze\u4f1a\u5728<code>build<\/code>\u76ee\u5f55\u4e2d\u751f\u6210\u4e00\u4e2a\u5305\u542bexe\u6587\u4ef6\u7684\u5b50\u76ee\u5f55\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6d4b\u8bd5\u53ef\u6267\u884c\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u5982\u540cPyInstaller\uff0c\u53cc\u51fb\u6216\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u751f\u6210\u7684exe\u6587\u4ef6\u4ee5\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>Py2exe\u7b80\u4ecb<\/strong><\/p>\n<\/p>\n<p><p>Py2exe\u662f\u53e6\u4e00\u4e2a\u7528\u4e8e\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aWindows\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u867d\u7136\u5b83\u4e0d\u5982PyInstaller\u548ccx_Freeze\u5e7f\u6cdb\u4f7f\u7528\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u4ecd\u7136\u6709\u6548\u3002<\/p>\n<\/p>\n<p><p><strong>\u5b89\u88c5Py2exe<\/strong><\/p>\n<\/p>\n<p><p>\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5Py2exe\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install py2exe<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f7f\u7528Py2exe\u8f6c\u6362Python\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u4ee5\u4e0b\u662f\u4f7f\u7528Py2exe\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efaPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u7f16\u5199\u5e76\u6d4b\u8bd5\u4f60\u7684Python\u811a\u672c\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u7f16\u5199setup\u811a\u672c<\/strong><\/p>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>setup.py<\/code>\u7684\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from distutils.core import setup<\/p>\n<p>import py2exe<\/p>\n<p>setup(console=[&#39;my_script.py&#39;])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPy2exe<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u5bfc\u822a\u5230<code>setup.py<\/code>\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python setup.py py2exe<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u751f\u6210\u7684\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>Py2exe\u4f1a\u5728<code>dist<\/code>\u76ee\u5f55\u4e2d\u751f\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6d4b\u8bd5\u53ef\u6267\u884c\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<p><p>\u53cc\u51fb\u6216\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u751f\u6210\u7684exe\u6587\u4ef6\u4ee5\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p><strong>\u603b\u7ed3<\/strong><\/p>\n<\/p>\n<p><p>\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u53ef\u4ee5\u4f7f\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u66f4\u5bb9\u6613\u5728\u6ca1\u6709Python\u73af\u5883\u7684Windows\u7cfb\u7edf\u4e0a\u5206\u53d1\u548c\u8fd0\u884c\u3002<strong>PyInstaller\u3001cx_Freeze\u548cPy2exe<\/strong>\u662f\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u7684\u4e09\u79cd\u5e38\u89c1\u5de5\u5177\u3002\u6bcf\u4e2a\u5de5\u5177\u90fd\u6709\u5176\u72ec\u7279\u7684\u529f\u80fd\u548c\u7528\u4f8b\uff0c\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u5177\u4f53\u9700\u6c42\u6765\u51b3\u5b9a\u3002\u65e0\u8bba\u4f7f\u7528\u54ea\u79cd\u5de5\u5177\uff0c\u786e\u4fdd\u5728\u76ee\u6807\u7cfb\u7edf\u4e0a\u8fdb\u884c\u5145\u5206\u6d4b\u8bd5\uff0c\u4ee5\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\u548c\u517c\u5bb9\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff1f<\/strong><br \/>\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8fc7\u7a0b\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5de5\u5177\u5982PyInstaller\u6216cx_Freeze\u6765\u5b9e\u73b0\u3002PyInstaller\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u9009\u62e9\uff0c\u5b83\u53ef\u4ee5\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u652f\u6301Windows\u3001Linux\u548cmacOS\u7b49\u64cd\u4f5c\u7cfb\u7edf\u3002\u7528\u6237\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>pyinstaller your_script.py<\/code>\uff0c\u7136\u540e\u5728\u751f\u6210\u7684dist\u76ee\u5f55\u4e2d\u627e\u5230\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p><strong>\u8f6c\u6362\u540e\u751f\u6210\u7684exe\u6587\u4ef6\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u673a\u5668\u4e0a\u8fd0\u884c\u5417\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u4f7f\u7528PyInstaller\u7b49\u5de5\u5177\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u662f\u72ec\u7acb\u7684\uff0c\u8fd9\u610f\u5473\u7740\u5b83\u4eec\u53ef\u4ee5\u5728\u6ca1\u6709\u5b89\u88c5Python\u7684\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002\u6240\u6709\u5fc5\u8981\u7684Python\u5e93\u548c\u4f9d\u8d56\u9879\u90fd\u4f1a\u88ab\u6253\u5305\u5230exe\u6587\u4ef6\u4e2d\uff0c\u4ece\u800c\u4f7f\u7a0b\u5e8f\u80fd\u591f\u72ec\u7acb\u6267\u884c\u3002<\/p>\n<p><strong>\u5728\u8f6c\u6362\u8fc7\u7a0b\u4e2d\u9047\u5230\u9519\u8bef\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u5728\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3aexe\u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u7f3a\u5c11\u4f9d\u8d56\u9879\u6216\u8def\u5f84\u95ee\u9898\u3002\u5efa\u8bae\u4ed4\u7ec6\u67e5\u770b\u547d\u4ee4\u884c\u4e2d\u8f93\u51fa\u7684\u9519\u8bef\u4fe1\u606f\uff0c\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5b89\u88c5\u7f3a\u5931\u7684\u5e93\u6216\u8c03\u6574\u8def\u5f84\u8bbe\u7f6e\u6765\u89e3\u51b3\u95ee\u9898\u3002\u6b64\u5916\uff0c\u67e5\u9605\u5b98\u65b9\u6587\u6863\u548c\u793e\u533a\u8bba\u575b\u4e5f\u662f\u5f88\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\uff0c\u8bb8\u591a\u5e38\u89c1\u95ee\u9898\u90fd\u6709\u8be6\u7ec6\u7684\u89e3\u7b54\u548c\u793a\u4f8b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff08exe\uff09\u53ef\u4ee5\u4f7f\u5176\u5728\u6ca1\u6709Python\u89e3\u91ca\u5668\u7684Windows\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002\u4f7f\u7528P [&hellip;]","protected":false},"author":3,"featured_media":986434,"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\/986424"}],"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=986424"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/986424\/revisions"}],"predecessor-version":[{"id":986437,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/986424\/revisions\/986437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/986434"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=986424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=986424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=986424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}