且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使 Python 脚本独立可执行文件在没有任何依赖的情况下运行?

更新时间:2023-09-20 10:56:10

您可以使用 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!).