Python Tkinter Window, Button and Label project
from tkinter import * #import tkinter library
root = Tk() #instance tkinger frameroot.title("Python Window") #add titleroot.geometry("600x300+660+86") #Size & Position of windowroot.resizable(width="true", height="true") # Window resizedef clickme(): #Use of functionroot2 = Tk()root2.geometry("700x300") #new tkinter window createroot2.config(bg="#C0FF3E")lbl=Label(root2, text="Hello, How are you", font=("Times new roman", 30, "bold"),bg="#C0FF3E", foreground="red")lbl.pack(pady=60) #label is created and set to root2 windowbtn = Button(root, text="Click Me", width=20, height=2,border=8, background="#FF7F24",font=("Times", 18, "bold"), command=clickme) #button createdbtn.pack(pady=70) # button packroot.mainloop()
إرسال تعليق