Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to set a image as background in tkitner

# Import module 
from tkinter import *
  
# Create object 
root = Tk()
  
# Adjust size 
root.geometry("400x400")
  
# Add image file
bg = PhotoImage(file = "Your_image.png")
  
# Show image using label
label1 = Label( root, image = bg)
label1.place(x = 0, y = 0)
  
label2 = Label( root, text = "Welcome")
label2.pack(pady = 50)
  
# Create Frame
frame1 = Frame(root)
frame1.pack(pady = 20 )
  
# Add buttons
button1 = Button(frame1,text="Exit")
button1.pack(pady=20)
  
button2 = Button( frame1, text = "Start")
button2.pack(pady = 20)
  
button3 = Button( frame1, text = "Reset")
button3.pack(pady = 20)
  
# Execute tkinter
root.mainloop()
Comment

PREVIOUS NEXT
Code Example
Python :: rename colmnname in dataframe scala 
Python :: python write to file 
Python :: how to scroll by in selenium python 
Python :: set index to column pandas 
Python :: tkinter minsize 
Python :: how to make computer go in sleep mode using pythn 
Python :: what happen when we apply * before list in python 
Python :: cors error in flask 
Python :: python string list to list 
Python :: python open script in new terminal 
Python :: how to clear console in repl.it python 
Python :: standardize columns in pandas 
Python :: opencv grayscale to rgb 
Python :: exclude columns pandas 
Python :: opencv python convert rgb to hsv 
Python :: split string in the middle python 
Python :: how to sum digits of a number in python 
Python :: matplotlib plot adjust margins 
Python :: how to detect a keypress tkinter 
Python :: train_test_split without shuffle 
Python :: like in mysqldb python 
Python :: bar chart with seaborn 
Python :: pandas remove index column when saving to csv 
Python :: How to check how much time elapsed Python 
Python :: python join generators 
Python :: python fdr correction 
Python :: add favicon fastapi 
Python :: PySpark get columns with null or missing values 
Python :: python map input 
Python :: python first two numbers 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =