Python将图像插入Tkinter文本小部件
问题描述:
我正在用Python创建一个简单的聊天框,我想将图像(表情符号)插入TKinter文本小部件.我已经使用以下代码尝试过:
Im creating a simple chat box in Python and I want to insert an image(emoticons) to a TKinter text widget. I have tried it using this code:
img = Image.open("icon.jpg")
self.bigText.insert(END, img) # bigText is the text widget
上面代码的输出是
<PIL.JpegImagePlugin.JpegImageFile instance at 0x01AB5A30>
而不是图像.