DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Python Package and Distribution Tools


Python打包工具主要分两种,一种是freezer,以 PyInstaller 为代表,把Python编译器,主脚本以及依赖库放一起打个包, 用户在没有Python的环境下也能用,这种方式决定了这样的“可执行文件”虽然形式上是 二进制代码,但不是真正意义上的native executable, 运行效率和Python脚本差不多,反编译比较容易,打包成功率高。

第二种是compiler,以 Nuitka 为代表, 将Python代码转换为C++代码,再编译为binary code,生成的是真正的native executable, 与C++, Go, Haskell这些静态编译器生成的可执行文件类似, 运行效率会有比较大的提升,但编译失败的风险也更大一些。



Published

Apr 4, 2018

Last Updated

Apr 4, 2018

Category

Tech

Tags

  • compiler 1
  • distribute 1
  • executable 2
  • python 136

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor