py2exe 打包

来源:互联网 发布:libuv编程 编辑:程序博客网 时间:2024/05/22 15:57
from distutils.core import setup
import py2exe

options = {"py2exe":
            {   "compressed": 1,  
                "optimize": 2,   
                "bundle_files": 1   # <span style="color: rgb(255, 128, 0); line-height: 15px; white-space: pre; background-color: rgb(253, 253, 253); ">所有文件打包成一个exe文件</span>
            }  
          }  
setup(     
    version = "1.0.0",  
    description = "description for your exe",  
    name = "hello",  
    options = options,  
    zipfile = None, # 不生成zip库文件 
    console = [{"script": "pyqt.py" }],    
    )   

2.win窗口
from distutils.core import setup
import py2exe

# Set options
options ={ 'py2exe':
                {
                    'dll_excludes':['w9xpopen.exe'] #This file is for win9x platform
                }
        }

# Setup
setup ( options  = options,
        windows = [{
                        'script': 'test.py'
                  }]
      )

python setup.py py2exe
0 0
原创粉丝点击