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时出现这样的错误时,显式调用下
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
相关文章推荐
- python3.x和python2.x区别
- python概述
- python pexpect
- python正则表达式--基本用法和函数(一个例子)
- python中的map、filter、reduce函数
- Python入门语法要点
- Python 小甲鱼教程 课后练习39
- PyMySQL-在Python 3.x下连接MySQL数据库的方法
- Python随堂笔记10-11-12
- Python爬虫实践:从中文歌词库抓取歌词
- 【Python】入门二
- python中string模块
- Python学习进程(5)Python语法
- caffe的python接口学习(4):mnist实例---手写数字识别
- Python变量类型(l整型,长整形,浮点型,复数,列表,元组,字典)学习
- Python时间和日期学习
- windows下如何下载并安装Python 3.5.
- 关于python中pymysql数据编码问题
- 关于Python文件操作
- Python 函数