mac 用pyinstaller打包,使用icns图标格式而不是ico

-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">, --icon <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">

FILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the icon to the .app bundle on Mac OS. If an image file is entered that isn’t in the platform format (ico on Windows, icns on Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use “NONE” to not apply any icon, thereby making the OS show some default (default: apply PyInstaller’s icon)

mac 用pyinstaller打包,使用icns图标格式而不是ico

注意要将icns图标放在py一个文件夹中,可以利用转换器将图片转化为icns图标,

一个在线的转化icns网址,下载稍慢但是可以用

JPG转ICNS - 在线转换图像文件

pyinstaller -w -i pika.icns -F 科勒小雪花.py

不知道为什么,一定要加-w才可以成功,-w 是去掉黑窗口,加了之后才能生成有正常图标的程序,

然后你就可以生成一个能在mac上运行的有可爱图标的程序了~

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值