英文:
What's the difference between PyInstaller and auto-py-to-exe?
问题
我正在开发一个用于macOS的小型应用程序,我想将其转换为可执行文件。为此,我使用了auto-py-to-exe
。我一直以为它只是PyInstaller
的图形界面,但这篇文章说:“另一个优点是Auto-py-to-exe创建的可执行文件是源代码的构建版本,而不是原始源代码”。我一直以为这两个工具的结果应该是一样的,不是吗?
auto-py-to-exe
还提供了PyInstaller
的命令行提示符。如果我执行这个命令,我会得到三个输出(build
和dist
文件夹以及.spec
文件)。auto-py-to-exe
只给出一个文件夹作为输出,我认为它应该与dist
文件夹相同。这是真的吗?如果auto-py-to-exe
使用PyInstaller
,那么是否也应该有一个build
文件夹和一个.spec
文件?
我有点困惑,找不到一个适当的auto-py-to-exe
手册来解释这个问题。也许有人可以在这里解释一下 :).
英文:
I am developing a small app for macOS that I want to convert as an executable. For this I use auto-py-to-exe
. I always thought it's just a GUI for PyInstaller
, but this article states, that "Another advantage is that Auto-py-to-exe creates an executable file that is a built version of the source code rather than the original source code". I always thought the results of these both tools should be the same, shouldn't they?
auto-py-to-exe
also gives you the PyInstaller
command-line prompt. If I execute this, I get the three outputs (folders build
and dist
and the .spec
file). auto-py-to-exe
only gives one folder as output, which I thought it should be the same then the dist
folder. Is that true? If auto-py-to-exe
uses PyInstaller
shouldn't there also be a build
folder and a .spec
file?
I am a bit confused and I don't find a proper manual for auto-py-to-exe
explaining this. Maybe somebody can shed some light here :).
答案1
得分: 3
auto-py-to-exe只是PyInstaller上的一个UI层 - 它在内部调用PyInstaller。
直接来自auto-py-to-exe的README.md
使用简单的图形界面和Python中的PyInstaller将.py转换为.exe的转换器。
auto-py-to-exe在PyInstaller的基础上提供以下功能:
- 用于使用PyInstaller的UI
- 对PyInstaller输入进行基本验证(如路径和.ico文件类型)
- 在临时目录中构建您的脚本,因此无需手动清理
- PyInstaller和Python版本检查(某些版本可能不兼容)
- 通常发生问题的一些默认差异(目前我们只更改递归限制)
- 一些非英语语言支持
声明:我是auto-py-to-exe的创建者
英文:
auto-py-to-exe is just a UI layer on top of PyInstaller - it calls PyInstaller internally.
Directly from auto-py-to-exe's README.md
> A .py to .exe converter using a simple graphical interface and PyInstaller in Python.
auto-py-to-exe offers the following on top of PyInstaller:
- A UI to use PyInstaller
- Basic validation on PyInstaller inputs (like paths and .ico file types)
- Builds your script in a temporary directory so there is no need for manual cleanup
- PyInstaller and Python version checks (where some versions can be incompatible)
- Minor default differences where issues typically occur (at the moment we just change the recursion limit)
- Some non-English language support
Disclosure: I am the creator of auto-py-to-exe
答案2
得分: -1
以下是翻译好的部分:
PyInstaller:
- 特点:PyInstaller是一个广泛使用的工具,可以将Python脚本及其依赖项打包成单个可执行文件,适用于各种平台(Windows、macOS、Linux)。
- 灵活性:它提供更多的自定义选项并支持更高级的功能,适用于具有独特要求的复杂项目。
- 命令行界面:PyInstaller主要通过命令行界面(CLI)操作。用户需要通过命令行参数提供配置选项和参数。
- 使用便捷性:虽然功能强大,但PyInstaller可能对初学者有较陡的学习曲线,因为它具有广泛的选项和命令行交互。
- 依赖处理:它处理依赖关系,确保可执行文件包含所有所需的库和资源。
- 平台支持:PyInstaller支持多个平台,允许您为不同操作系统创建可执行文件。
auto-py-to-exe:
- 特点:auto-py-to-exe是一个图形用户界面(GUI)工具,简化了将Python脚本转换为可执行文件的过程。
- 用户友好性:它设计成用户友好,特别适合不熟悉命令行界面或打包概念的人。
- GUI界面:auto-py-to-exe提供了一个可视化界面,用户可以在其中配置选项、选择脚本文件并调整设置,无需使用命令行。
- 简化配置:它提供预定义的设置和配置文件,使创建可执行文件更加简便,无需深入复杂的配置。
- 更简单的项目:auto-py-to-exe可能更适合具有简单要求的项目,其中定制化不是主要关注点。
- 依赖处理:与PyInstaller类似,auto-py-to-exe处理依赖项并将它们与可执行文件捆绑在一起。
- 平台支持:尽管最初是为Windows开发的,但auto-py-to-exe可能不提供与PyInstaller相同水平的跨平台兼容性。
总之,主要区别在于它们的复杂性和打包Python脚本的方法。PyInstaller通过命令行界面提供更多的控制和自定义选项,适用于复杂项目。另一方面,auto-py-to-exe提供了一个更简单的基于GUI的解决方案,适合寻求更用户友好和简化的方法来从Python脚本创建独立可执行文件的用户。选择两者之间取决于您的项目复杂性、对命令行工具的熟悉程度以及对基于GUI界面的偏好。
英文:
Both PyInstaller and auto-py-to-exe are tools used to convert Python scripts into standalone executable files, but they have different features, functionalities, and levels of user-friendliness.
PyInstaller:
- Features: PyInstaller is a well-established and widely-used tool that
can package Python scripts along with their dependencies into a
single executable file for various platforms (Windows, macOS, Linux). - Flexibility: It offers more customization options and supports more
advanced features, making it suitable for complex projects with
unique requirements. - Command-Line Interface: PyInstaller is primarily operated through the
command-line interface (CLI). Users need to provide configuration
options and parameters via command-line arguments. - Ease of Use: While powerful, PyInstaller might have a steeper
learning curve for newcomers due to its extensive options and
command-line interaction. - Dependency Handling: It handles dependencies, ensuring that the
executable file contains all the required libraries and resources. - Platform Support: PyInstaller supports multiple platforms, allowing
you to create executables for different operating systems.
auto-py-to-exe:
- Features: auto-py-to-exe is a graphical user interface (GUI) tool
that simplifies the process of converting Python scripts to
executables. - User-Friendly: It's designed to be user-friendly, especially for
those who are not familiar with command-line interfaces or packaging
concepts. - GUI Interface: auto-py-to-exe provides a visual interface where users
can configure options, select script files, and adjust settings
without using the command line. - Simplified Configuration: It provides predefined settings and
profiles, making it easier to create executable files without delving
into complex configuration. - Simpler Projects: auto-py-to-exe might be better suited for simpler
projects with straightforward requirements, where customization is
not a primary concern. - Dependency Handling: Like PyInstaller, auto-py-to-exe handles
dependencies and bundles them with the executable file. - Platform Support: While originally developed for Windows,
auto-py-to-exe might not offer the same level of cross-platform
compatibility as PyInstaller.
In summary, the main difference lies in their complexity and approach to packaging Python scripts. PyInstaller offers more control and customization through the command-line interface, making it suitable for complex projects. On the other hand, auto-py-to-exe provides a simpler, GUI-based solution, ideal for users seeking a more user-friendly and streamlined approach for creating standalone executables from Python scripts. The choice between the two depends on your project's complexity, your familiarity with command-line tools, and your preference for a GUI-based interface.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论