所以我有一个依赖于几个模块的
python脚本.特别是pexpect和pyinoitify.我知道你可以将一个python脚本编译成windows中的.exe,但在linux中是否有相对等价的东西?我不关心它是二进制文件,我只是希望能够分发我的脚本而不需要单独安装pexpect和pyinotify.这可能/有价值吗?
解决方法
cx_Freeze
是一种将Python脚本“冻结”为独立二进制形式的跨平台方式.根据他们的网站:
cx_Freeze is a set of scripts and modules for freezing Python scripts into executables in much the same way that py2exe and py2app do. Unlike these two tools,cx_Freeze is cross platform and should work on any platform that Python itself works on. It requires Python 2.3 or higher since it makes use of the zip import facility which was introduced in that version.