发布时间:2019-08-07 14:07:05编辑:auto阅读(2370)
①.需要在目录下面创建一个文件 。setup.py
②.写入代码:
import sys from cx_Freeze import setup, Executable import os os.environ['TCL_LIBRARY'] = r'C:\Python36-32\tcl\tcl8.6' os.environ['TK_LIBRARY'] = r'C:\Python36-32\tcl\tk8.6' include_files=[ r'C:\Python36-32\DLLs\tcl86t.dll', r'C:\Python36-32\DLLs\tk86t.dll' ] # Dependencies are automatically detected, but it might need fine tuning. build_exe_options = {"packages": ["os"], "excludes": ["tkinter"],"include_files":include_files} # GUI applications require a different base on Windows (the default is for a # console application). base = None if sys.platform == "win32": base = "Win32GUI" setup(name="video1",#打完包后取的名字 version="2.1",#版本 description="aaaaa",#描述 options={"build_exe": build_exe_options}, executables=[Executable("video.py", base=base)])③.命令:
python setup.py bdist_msi 生成安装包以及直接运行的exe文件
python setup.py build 生成exe可执行程序
上一篇: python 3D绘制立体几何
下一篇: Python3实现常用数据标准化方法
47494
45794
36793
34324
28968
25598
24443
19611
19111
17632
5466°
6048°
5570°
5638°
6573°
5376°
5378°
5884°
5855°
7170°