zoukankan      html  css  js  c++  java
  • python to 可执行文件

    • cx_Freeze for Windows, Linux, and Mac OS X (Python 2.7, 3.x)
    • pyinstaller for Windows, Linux, and Mac OS X (Python 2.7, 3.3-3.5)
    • bbfreeze for Windows and Linux (Python 2.4-2.7)
    • py2exe for Windows (Python 2.6, 2.7)
    • py2exe for Windows (Python 3.3-3.5)
    • Freeze for Linux and maybe Mac OS X (Python 2.x)
    • py2app for Mac OS X (Python 2.x)

    py2exe for python2.7

    pip install py2exe_py2
    

      

    py2exe for python3.3~

    pip install py2exe
    

    假设有一个test.py 的需要一个转换的文件;

    写一个gen.py ,将test.py填入 setup(console) 处:

    from distutils.core import setup
    import py2exe
    
    setup( console=['test.py'],
           zipfile = None,
           options = {'py2exe' : { 
                         "bundle_files": 1,
                         "dll_excludes": ["MSVCP90.dll","w9xpopen.exe"]
                         }
                      }
     
    

    在同一目录执行:

    python gen.py py2exe

    生成一个比较大的可执行文件,在目录  dist 下;

  • 相关阅读:
    make menuconfig出现乱码
    内存中的变量和值
    is&==
    python小整数池
    生成器
    GIL
    grub rescue问题修复
    期末考试
    期末要求
    选课练习
  • 原文地址:https://www.cnblogs.com/clor001/p/6558424.html
Copyright © 2011-2022 走看看