使 python 文件成为可执行文件

Make a python file an executable

有没有办法从 python 文件生成可执行文件,但不加载 python 解释器? py2exepyinstaller 都这样做。还有其他图书馆没有吗?

尝试Nuitka。它将 python 代码转换为 C,然后将其编译为可执行文件。它也比普通的 CPython 更快。

Nuitka is already slightly faster than CPython, but there is work to be done to include as many C optimizations as possible. We currently get a 312% speedup in pystone, which is a good start. (source: Nuitka version 0.6.0 with Python 2.7.)

注意:这适用于 python 2 和 3