py2exe 命令提示符 exe 更改 shell 窗口大小和颜色?
我正在尝试更改已编译的 exe 的图标,例如在 setup.py 中使用此脚本:
setup(name = "Program Title",
version = "1.0",
options = {"py2exe" : {"compressed" : 1,
"optimize" : 2,
"bundle_files" : 2 }},
console=[{'script': 'program.py',
"icon_resources": [(0, "icon.ico"), (1, "icon.ico"), (42, "icon.ico")]
}],
description = "some description",
author = "author",
author_email ="[email protected]",
license = "wxWindows Licence",
url = "http://some.website.here,
)
但不幸的是,当它编译时,.ico 没有保留(与 program.py 和 setup.py 位于同一目录中)
另外我想知道是否可以通过更改 py2exe 弹出的窗口的背景颜色和大小来稍微更改命令提示符的外观...我检查了文档,但它并没有那么有用。另外,窗口模式不适用于我的程序,它需要控制台。
i'm trying to change the compiled exe's icon and such using this script for my setup.py:
setup(name = "Program Title",
version = "1.0",
options = {"py2exe" : {"compressed" : 1,
"optimize" : 2,
"bundle_files" : 2 }},
console=[{'script': 'program.py',
"icon_resources": [(0, "icon.ico"), (1, "icon.ico"), (42, "icon.ico")]
}],
description = "some description",
author = "author",
author_email ="[email protected]",
license = "wxWindows Licence",
url = "http://some.website.here,
)
but unfortunately, when it compiles the .ico didn't carry over (is in same dir as program.py and setup.py)
Also i was wondering if it is possible to change the command prompt look a bit by changing the background color and size of the window as it pops up through py2exe... I checked the documentation, but it's not really that helpful. Also window'd mode doesn't work for my program, it requires console.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看这些有关彩色控制台的教程:
将颜色使用 Python 的 Windows 控制台
更改 Windows 控制台字符属性
控制台模块
图标,请尝试 CustomIcons 中的建议:
“在系统上添加多个图标的重要说明这个方法不是工作:经过大量研究(血、汗和泪),我发现为什么具有多种尺寸的图标有时不起作用,事实是,在制作图标时,首先添加较大的图标尺寸,然后。较小的(例如 png2ico icon.ico icon_128x128.png icon_64x64.png icon_48x48.png icon_32x32.png icon_16x16.png)”
Check out these tutorials for a colored console:
Bring Colors to the Windows Console with Python
Change Windows Console Character Attribute
The Console Module
For the icon, try this suggestion from CustomIcons:
"Important Note For Adding Multiple Icons On Systems Where This Method Is Not Working: After much research (blood, sweat, and tears), I have found why icons with multiple sizes sometimes do not work. The truth is, is that the order matters. When making the icon, add the larger icon sizes first, then the smaller ones. (e.g. png2ico icon.ico icon_128x128.png icon_64x64.png icon_48x48.png icon_32x32.png icon_16x16.png)"