Write a gui python program using tkinter to add an image


Problem

Write a GUI Python program using tkinter to add an image and work with fonts and colors.

A. Start with Gif Demo.py if you wish.

B. the following web page uses it as a reference (Labels in Tkinter): https://python-course.eu/tkinter/labels-in-tkinter.php

C. choose a unique gif file (Note your gif will not be animated.) Please upload your gif with your .py file.

D. Use frames to make the window look better. Keep the buttons and put in a separate frame at the bottom of the screen.

E. Use three different labels with 3 different formats and colors. Do not just use the formats in Gif Demo.

F. Add a message widget. Not a message box, a message widget.

G. Make the window somehow coherent. In other words, do not just put a bunch of random things in the window.

H. I want to see several descriptive comments throughout the code. If you use an existing program, change the comments as needed.

I. Name the program Assign5-LastFirstInit.py where Last is your last name and FirstInit is your first initial. For example: Assign5-SamL.py

J. At the top of the program add three lines of comments - Your name, the date, and the assignment number.

K. Upload your program AND the .gif file.

Gif Demo.py

# This program demonstrates adding an image.
# When the user clicks the Button, an
# info dialog box is displayed.
import tkinter
import tkinter.messagebox
class MyGUI:
def __init__(self):
# Create the main window widget.
self.main_window = tkinter.Tk()
# Create the PhotoImage, then load image to a label
self.logo = tkinter.PhotoImage(file="screenshot.gif")
self.labelImage= tkinter.Label(self.main_window, image=self.logo)
self.label1 = tkinter.Label(self.main_window,
text='Look at my cool gif!',
fg = "dark green",
bg = "yellow")

# Create a Button widget. The text 'Click Me!'
# should appear on the face of the Button. The
# do_something method should be executed when
# the user clicks the Button.
self.my_button = tkinter.Button(self.main_window,
text='Click Me!',
command=self.do_something)
# Create a Quit button. When this button is clicked
# the root widget's destroy method is called.
# (The main_window variable references the root widget,
# so the callback function is self.main_window.destroy.)
self.quit_button = tkinter.Button(self.main_window,
text='Quit',
command=self.main_window.destroy)

# Pack.
self.labelImage.pack(side="right")
self.label1.pack(side="left")
self.my_button.pack(side="bottom")
self.quit_button.pack(side="bottom")

# Enter the tkinter main loop.
tkinter.mainloop()
# The do_something method is a callback function
# for the Button widget.

def do_something(self):
# Display an info dialog box.
tkinter.messagebox.showinfo('Response',
'Thanks for clicking the button.')
# Create an instance of the MyGUI class.
my_gui = MyGUI()

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Write a gui python program using tkinter to add an image
Reference No:- TGS03323560

Expected delivery within 24 Hours