0
884views
Write a python program which displays a message on clicking a button.
1 Answer
written 2.4 years ago by |
Explanation:-
Code:-
import tkinter.messagebox
from tkinter import *
def onClick():
root = Tk()
w = Label(root, text='Welcome to python programming')
w.pack()
root = tkinter.Tk()
button = tkinter.Button(root,text = "Click Me", command = onClick)
button.pack()
root.mainloop()
Output:-
Root Window
Message Window