擅长:python、mysql、java
<p>奇怪的是,Python似乎没有多少创建/编辑*.ico文件的功能。听起来您的最佳选择是获取<a href="http://www.imagemagick.org/download/python/" rel="nofollow">ImageMagick</a>的Python绑定:</p>
<ul>
<li><a href="https://stackoverflow.com/questions/45507/is-there-a-python-library-for-generating-ico-files">https://stackoverflow.com/questions/45507/is-there-a-python-library-for-generating-ico-files</a></li>
</ul>
<p>但是,我找不到任何与绑定相关的文档。从我所读到的,Python图像库(PIL)可以读取图标文件,但不能创建它们。但是,您可能可以使用PIL来创建位图文件:</p>
<ul>
<li><a href="http://effbot.org/imagingbook/" rel="nofollow">http://effbot.org/imagingbook/</a></li>
<li><a href="http://vkedco.blogspot.com/2011/02/creating-and-saving-bitmaps-with-python.html" rel="nofollow">http://vkedco.blogspot.com/2011/02/creating-and-saving-bitmaps-with-python.html</a></li>
</ul>