Answers for "python how to add picture to label with tkinter"

0

python how to add picture to label with tkinter

# python import tkinter
from tkinter import *
# creating a window
root = Tk() 
root.geometry("500x500") # sets the width of a window
img = PhotoImage(file="info.png") # you need to have a real file in the folder
# you are working with
eg = Label(root, image=img)
# creats a program to show the window
root.mainloop()
Posted by: Guest on February-01-2022

Python Answers by Framework

Browse Popular Code Answers by Language