电脑不能运行"/>
python打包的exe有的电脑不能运行
用这种打包方式,会只生成bin文件,文件下只有一个exe,测试过是可以在其他地方运行的,即使没有安装python
from py2exe.build_exe import py2exefrom distutils.core import setupfrom glob import glob import py2exe import os, sysimport shutil if len(sys.argv) == 1: sys.argv.append("py2exe") includes = ["encodings", "encodings.*"]options = {"py2exe": { "compressed": 1, "optimize": 2, "includes": includes, "dist_dir": "bin", "bundle_files": 1 } } setup( version = "1.0", description = u'xxxxx',#描述你这个exe的 name = "xxx", options = options, zipfile = None, console=[{"script": "xxxx.py"}], data_files=[] ) os.remove("bin//w9xpopen.exe") shutil.rmtree("build")
取消
评论
更多推荐
python打包的exe有的电脑不能运行
发布评论