如何使 Python 脚本独立可执行文件在没有任何依赖的情况下运行? [英] How can I make a Python script standalone executable to run without ANY dependency?
本文介绍了如何使 Python 脚本独立可执行文件在没有任何依赖的情况下运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在构建一个 Python 应用程序并且不想强迫我的客户安装 Python 和模块.
I'm building a Python application and don't want to force my clients to install Python and modules.
那么,有没有办法将 Python 脚本编译为独立的可执行文件?
So, is there a way to compile a Python script to be a standalone executable?
推荐答案
您可以使用 py2exe 已回答并使用 Cython 转换 .pyc
中的关键 .py
文件>、C编译文件,如Windows中的.dll
和Linux上的.so
.
You can use py2exe as already answered and use Cython to convert your key .py
files in .pyc
, C compiled files, like .dll
in Windows and .so
on Linux.
它比常见的 .pyo
和 .pyc
文件更难恢复(而且性能也有所提高!).
It is much harder to revert than common .pyo
and .pyc
files (and also gain in performance!).
这篇关于如何使 Python 脚本独立可执行文件在没有任何依赖的情况下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文