如何替换 Tkinter 应用程序中的图标 [英] how to replace the icon in a Tkinter app

查看:24
本文介绍了如何替换 Tkinter 应用程序中的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 10 上使用 Python 3.5.0 并想替换它:

I am using Python 3.5.0 on Windows 10 and want to replace this:

推荐答案

要更改图标,您应该使用 iconbitmapwn_iconbitmap 我的印象是该文件您希望将其更改为必须是 ico 文件.

To change the icon you should use iconbitmap or wn_iconbitmap I'm under the impression that the file you wish to change it to must be an ico file.

import tkinter as tk

root = tk.Tk()
root.iconbitmap("myIcon.ico")

这篇关于如何替换 Tkinter 应用程序中的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆