1. Write the following codes and submit the files in the “Submission.”
Submis
1. Write the following codes and submit the files in the “Submission.”
Submission:
1. A summary of the program, what does the program do
2. Screenshot of the Running program
a).
import tkinter
def main():
# Create the main window widget.
main_window = tkinter.Tk()
#Enter the tkinter main loop.
tkinter.mainloop()
# Call the main function.
main()
=========================================
b)
import tkinter
class MyGUI:
def __init__(self):
# Create the main window widget.
self.main_window = tkinter.Tk()
# Create a Label widget containing the
# text ‘Hello World!’
self.label = tkinter.Label(self.main_window,
text=’Hello World!’)
# Call the Label widget’s pack method.
self.label.pack()
# Enter the tkinter main loop.
tkinter.mainloop()
# Create an instance of the MyGUI class.
my_gui = MyGUI()
Leave a Reply