Wednesday, February 3, 2021

python day 31 tkinter button with command function

 import tkinter

from tkinter import *


def display():

    print("this is praveen")

    print("this is working")

    

def calculate():

    print(5*10)


main_windows=tkinter.Tk()

main_windows.geometry("800x500")

main_windows.title("Hotel management")


name_Label=Label(main_windows , text="Hotel Management", font=("arial", 40))

name_Label.place(x=500,y=10)


btn=Button(main_windows, text="Display", fg='red', command=display)

btn.place(x=20, y=20)



btn=Button(main_windows, text="calculate", fg='red', command=calculate)

btn.place(x=80, y=20)

main_windows.mainloop()

python class topic video