解决py2exe打包后,总是多显示一个DOS黑色窗口的问题
时间:2020-10-16 22:01:31|栏目:Python代码|点击: 次
setup.py:
#!/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")]}],