python生成安装程序_python生成安装文件 msi

①.需要在目录下面创建一个文件 。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可执行程序

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值