Developing GUI using Python Tkinter Library

Program 1:  print text(with different colors, font etc) over an Image

import tkinter as tk

counter = 0
def counter_label(label):
  def count():
    global counter
    counter += 1
    label.config(text=str(counter))
    label.after(1000, count)
  count()

root = tk.Tk()
logo = tk.PhotoImage(file="speech-recognition.gif")

explanation = "I am Neelkanth Reddy"
label = tk.Label(root,
             # to proint text on top of image
             compound = tk.CENTER,
             # where the text should be printed on top of image
             text=explanation,
             fg = "red",
      font = "Verdana 60 bold",
             image=logo).pack(side="right")

w = tk.Label(root, fg="green")
w.pack()
counter_label(w)


root.mainloop()


Program 2: Print dynamic counter value on the text

import tkinter as tk
import time
#############################################################
# Global Variables
#############################################################
counter = 0

##############################################################
#  Procedures
##############################################################
def count():
    global counter
    counter += 1
    if (counter <= 100):
        label.config(text=str(counter))
    else :
       label.config(text="End of count")
       exit
 
   # Here 1000 is 1000 ms.
    # This is recursive function
    label.after(1, count)

# print count variable on the screen
def counter_label(label):
  count()


######################################################################
#           Main script starts here. 
######################################################################
root = tk.Tk()
root.title("Speech Recognition")
# Background image
logo = tk.PhotoImage(file="speech-recognition.gif")
label = tk.Label(root,
                 compound = tk.CENTER,
                 image=logo,
                 font = "Verdana 100 bold",
                 fg="Red")
label.pack()
counter_label(label)


root.mainloop()