{"id":30597,"date":"2024-05-21T15:40:57","date_gmt":"2024-05-21T07:40:57","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=30597"},"modified":"2024-05-21T15:40:57","modified_gmt":"2024-05-21T07:40:57","slug":"wordr%e5%88%b6%e4%bd%9cexe%e6%93%8d%e4%bd%9c%e5%8a%9e%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2024\/ruanjiankf\/30597\/","title":{"rendered":"wordr\u5236\u4f5cexe\u64cd\u4f5c\u529e\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"<p>Wor<a href=\"https:\/\/exe.yimenapp.com\/tool-3955.html\">\u6253\u5305exe\u4e3a\u5b89\u88c5\u7a0b\u5e8f<\/a>dr\u662f\u4e00\u6b3e\u57fa\u4e8ePython\u8bed\u8a00\u5f00\u53d1\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5236\u4f5c\u5de5\u5177\uff0c\u5b83<a href=\"https:\/\/exe.yimenapp.com\/tool-976.html\">windowsform\u6253\u5305web<\/a>\u53ef\u4ee5\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4f7f\u5f97\u7528\u6237\u4e0d\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u4ecb\u7ecdWordr\u5236\u4f5cexe\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<p>\u4e00\u3001\u539f\u7406<\/p>\n<p>Python\u662f\u4e00\u79cd\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u9700\u8981Python\u89e3\u91ca\u5668\u624d\u80fd\u8fd0\u884cPython\u7a0b\u5e8f\u3002\u800cWordr\u5219\u662f\u901a\u8fc7\u5c06Python\u89e3\u91ca\u5668\u548cPython\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5b9e\u73b0\u4e86Python\u7a0b\u5e8f\u7684\u72ec\u7acb\u8fd0\u884c\u3002\u5177\u4f53\u6765\u8bf4\uff0cWordr\u7684\u539f\u7406\u5982\u4e0b\uff1a<\/p>\n<p>1. \u5c06Python\u89e3\u91ca\u5668\u548cPython\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2azip\u6587\u4ef6\u3002<\/p>\n<p>2. \u5728zip\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u542f\u52a8\u811a\u672c\uff0c\u7528\u4e8e\u542f\u52a8Python\u89e3\u91ca\u5668\uff0c\u5e76\u6267\u884cPython\u7a0b\u5e8f\u3002<\/p>\n<p>3. \u4f7f\u7528pyin<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/20\/16\/02545564185.jpg\" \/><\/figure>\n<\/p>\n<p>staller\u5c06zip\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p>\u4e8c\u3001\u8be6\u7ec6\u6b65\u9aa4<\/p>\n<p>1. \u5b89\u88c5Python<\/p>\n<p>\u9996\u5148\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\uff0c\u53ef\u4ee5\u4ecePython\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8981\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u5c06Python\u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/p>\n<p>2. \u5b89\u88c5Wordr<\/p>\n<p>\u5728\u5b89\u88c5Python\u4e4b\u540e\uff0c\u9700\u8981\u5b89\u88c5Wordr\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u5b89\u88c5\uff0c\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pip install wordr<\/p>\n<p>&#8220;`<\/p>\n<p>3. \u7f16\u5199Python\u7a0b\u5e8f<\/p>\n<p>\u5728\u5b89\u88c5\u5b8cPython\u548cWordr\u4e4b\u540e\uff0c\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199Python\u7a0b\u5e8f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u9700\u8981\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2azip\u6587\u4ef6\uff0c\u4ee3\u7801\u4e2d\u9700\u8981\u6307\u5b9azip\u6587\u4ef6\u4e2d\u7684\u542f\u52a8\u811a\u672c\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>&#8220;`python<\/p>\n<p>from wordr import run<\/p>\n<p>run(&#8216;example.zip&#8217;, &#8216;example.py&#8217;)<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cexample.zip\u662f\u6253\u5305\u540e\u7684zip\u6587\u4ef6\uff0cexample.py\u662f\u542f\u52a8\u811a\u672c\u3002<\/p>\n<p>4. \u6253\u5305Python\u7a0b\u5e8f<\/p>\n<p>\u5728\u7f16\u5199\u5b8cPython\u7a0b\u5e8f\u4e4b\u540e\uff0c\u9700\u8981\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2azip\u6587\u4ef6\u3002\u53ef\u4ee5\u4f7f\u7528Python\u81ea\u5e26\u7684zipfile\u6a21\u5757\u8fdb\u884c\u6253\u5305\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`python<\/p>\n<p>import zipfile<\/p>\n<p>with zipfile.ZipFile(&#8216;example.zip&#8217;, &#8216;w&#8217;) as myzip:<\/p>\n<p>    myzip.write(&#8216;example.py&#8217;)<\/p>\n<p>&#8220;`<\/p>\n<p>5. \u4f7f\u7528pyinstaller\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n<p>\u5728\u6253\u5305\u597dzip\u6587\u4ef6\u4e4b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528pyinstaller\u5c06zip\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002\u9996\u5148\u9700\u8981\u5b89\u88c5pyinstaller\uff0c\u53ef\u4ee5\u901a\u8fc7pip\u5b89\u88c5\uff0c\u6253\u5f00\u547d\u4ee4\u884c\u7a97\u53e3\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pip install pyinstaller<\/p>\n<p>&#8220;`<\/p>\n<p>\u5b89\u88c5\u5b8cpyinstaller\u4e4b\u540e\uff0c\u9700\u8981\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u8fdb\u5165\u5230zip\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pyinstaller &#8211;onefile example.py<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cexample.py\u662f\u542f\u52a8\u811a\u672c\uff0c&#8211;onefile\u53c2\u6570\u8868\u793a\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n<p>6. \u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n<p>\u5728\u6253\u5305\u597d\u53ef\u6267\u884c\u6587\u4ef6\u4e4b\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4e0d\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002\u5982\u679c\u9700\u8981\u4f20\u9012\u53c2\u6570\uff0c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u7a97\u53e3\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>example.exe arg1 arg2 arg3<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cexample.exe\u662f\u53ef\u6267\u884c\u6587\u4ef6\uff0carg1\u3001arg2\u3001arg3\u662f\u4f20\u9012\u7684\u53c2\u6570\u3002<\/p>\n<p>\u603b\u7ed3<\/p>\n<p>Wordr\u662f\u4e00\u6b3e\u975e\u5e38\u5b9e\u7528\u7684Python\u53ef\u6267\u884c\u6587\u4ef6\u5236\u4f5c\u5de5\u5177\uff0c\u53ef\u4ee5\u8ba9Python\u7a0b\u5e8f\u72ec\u7acb\u8fd0\u884c\uff0c\u4e0d\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002\u672c\u6587\u4ecb\u7ecd\u4e86Wordr\u5236\u4f5cexe\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\uff0c\u5e0c\u671b\u80fd\u5bf9Python\u5f00\u53d1\u8005\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Wordr\u662f\u4e00\u6b3e\u57fa\u4e8ePython\u8bed\u8a00\u5f00\u53d1\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5236\u4f5c\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4f7f\u5f97\u7528\u6237\u4e0d\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u4ecb\u7ecdWordr\u5236\u4f5cex<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[26117,407,6972,81,179],"topic":[],"class_list":["post-30597","post","type-post","status-publish","format-standard","hentry","category-ruanjiankf","tag-screxe","tag-407","tag-htmlexe","tag-81","tag-179"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/30597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=30597"}],"version-history":[{"count":1,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/30597\/revisions"}],"predecessor-version":[{"id":30622,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/30597\/revisions\/30622"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=30597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=30597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=30597"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=30597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}