当前使用 py2exe 打包后,执行 exe 时候,除了正常程序意外,还有一个 DOS 黑色窗口,如图:

#!/usr/bin/env python
# coding=utf-8
from distutils.core import setup
import py2exe
setup(
description = 'software',
version = '0.0.1',
console=[{"script": "main.py", "icon_resources": [(1, "icon.ico")]}],
options = {
'py2exe': {
'compressed': 1,
'optimize': 2,
'bundle_files': 2
}
}
)
其中把 console 更改为 windows 即可,重新打包
console=[{"script": "main.py", "icon_resources": [(1, "icon.ico")]}],
windows=[{"script": "main.py", "icon_resources": [(1, "icon.ico")]}],
相关文章
- Python中字符编码的总结和对比:Python 2.x的str和unicode vs Python 3.x的bytes和str
- Python:[Errno 32] Broken pipe 导致线程crash解决方法
- python的mysql连接池并加入缓存过期
- Python2(Python 2.x版本)和Python3(Python 3.x版本)之间的区别
- django错误一则untimeWarning: DateTimeField received a naive datetime
- 一个check_mk源码小bug的解决
转载请注明:爱开源 » 解决 py2exe打包后,总是多显示一个DOS黑色窗口
转载请注明:爱开源 » 解决 py2exe打包后,总是多显示一个DOS黑色窗口