7. Write a python Tkinter program to display two buttons. Click first button can display word "Practice more Tkinter exercises!" and another button to quit the window.
The output is:
Sample Answer:
import tkinter as tk
def t_info():
print("Practice more Tkinter exercises!")
window = tk.Tk()
frame = tk.Frame(window)
frame.pack()
text_button= tk.Button(frame,
text="Click",
command=t_info)
text_button.pack(side=tk.LEFT)
exit_button = tk.Button(frame,
text="Exit",
fg="green",
command=quit)
exit_button.pack(side=tk.RIGHT)
window.mainloop()
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)