您的位置:首页 > 编程语言 > Python开发

python使用cxfreeze打包

2016-07-19 14:49 357 查看
1.下载cxfreeze,或者通过pycharm下载

2.配置打包文件

import sys

from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.

build_exe_options = {"packages": ["os"]}

# 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 = "guifoo",

        version = "0.1",

        description = "My GUI application!",

        options = {"build_exe": build_exe_options},

        executables = [Executable("C:\Users\wqjzz\PycharmProjects\untitled4\weikuangku\SendServices.py", base=base)])

命名为setup.py

放到项目的当前文件夹

3.执行命令:python setup.py build

即生成了exe文件

注:

出现

ImportError: No module named _mssql,打开exe时出现这样的错误时,显式调用下

import _mssql
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: