将简单的Python脚本转换为Windows可执行文件的过程 [英] Process to convert simple Python script into Windows executable
问题描述
我写了一个脚本,将帮助Windows用户在她的日常生活。我想简单地发送她的.exe,而不要求她安装python,dll或必须处理任何其他文件。
I wrote a script that will help a Windows user in her daily life. I want to simply send her the .exe and not ask her to install python, dlls or have to deal with any additional files.
我已经阅读了大量的stackoverflow关于将Python脚本编译为可执行文件的条目。我有点困惑,因为有很多选项,但有些似乎过时了(2008年以来没有更新),没有一个是简单的,我不要问这个现在后几个小时花在这。
I've read plenty of the stackoverflow entries regarding compiling Python scripts into executable files. I am a bit confused as there are many options but some seem dated (no updates since 2008) and none were simple enough for me not to be asking this right now after a few hours spent on this.
我希望有一个更好的,最新的方法来做到这一点。
I'm hoping there's a better, up-to-date way to do this.
into:
- pylunch
- py2exe
- cx_Freeze
- py2app (only for Mac)
- pyinstaller
- bbfreeze
但我可以不能让他们工作或不能理解如何获得我需要的结果。我最近得到的是与py2exe,但它仍然给我的MSVCR71.dll
but either I couldn't get them to work or couldn't understand how to get the result I need. The closest I got was with py2exe but it still gave me the MSVCR71.dll
我会喜欢一个一步一步的答案,因为我也无法跟随一些这里的调整答案在这里需要一些以前的了解如何使用py2exe或一些其他工具。
I would appreciate a step-by-step answer as I was also unable to follow some of the tweaking answers here that require some prior understanding of how to use py2exe or some of the other tools.
我使用Python 2.5作为一个模块只有可用
I'm using Python 2.5 as one of the modules is only available for that version.
推荐答案
如果使用 - onefile,PyInstaller将创建一个单文件可执行文件
PyInstaller will create a single-file executable if you use the --onefile
option (though what it actually does is extracts then runs itself).
有一个简单的PyInstaller教程此处。如果您对使用它有任何问题,请张贴...
There's a simple PyInstaller tutorial here. If you have any questions about using it, please post them...
这篇关于将简单的Python脚本转换为Windows可执行文件的过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!