Ubuntu下Tkinter的图标问题

我在Ubuntu学习python的Tkinter时候遇到使用“iconbitmap”报错的问题,找了许多答案但是关于PIL都不能下载

在这里我想说不要下载PIL,下载Pillow就行了,然后通过from Pillow.PIL import ImageTk就行了

import tkinter
from PIL.ImageTk import PhotoImage

win = tkinter.Tk()
win.title("软件小组")
icon = PhotoImage(file="/home/night/Project/PycharmProjects/study/python_Tkinter/first.png")
win.tk.call('wm', 'iconphoto', win._w, icon)
win.geometry("400x400+400+200")

 

你可能感兴趣的:(Ubuntu下Tkinter的图标问题)