cx_freeze打包EXE文件

创建setup.py文件

import os
import sys
from cx_Freeze import setup, Executable


build_exe_options = dict(packages=['conf', 'core', 'numpy'], excludes=[])

os.environ['TCL_LIBRARY'] = r'C:\Users\panhw\Anaconda3\tcl\tk8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\panhw\Anaconda3\tcl\tk8.6'

base = None
if sys.platform == 'win32':
base = 'Win32GUI'

executables = [
Executable(script='main.py', base=base)
]

setup(name='test to exe',
version='0.1',
description='test from py file to exe file',
options = {'build_exe': build_exe_options},
executables=executables
)




执行python setup.py build

posted on 2018-08-28 09:22  潘红伟  阅读(367)  评论(0编辑  收藏  举报

导航