Set Image in Label


If You Want to set Image on Label You Must do This.


Example:

from tkinter import *

window =Tk()
window.title("Image In Label")
window.geometry("800x400+400+86")
window.resizable(height="true", width="true")


pic = PhotoImage(file="E:\Python Work\computer.png")
lbl_image = Label(window, image=pic, text="Computer", compound="top")
lbl_image.pack()


window.mainloop()


Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.



Lets Enjoy.........



Post a Comment

أحدث أقدم