Make a Clicking App using Python and Tkinter

In this tutorial we will be working with the GUI components for Python programming language and make a clicking app using Tkinter. This will be start of our Tkinter and Python journey again and we will get to make alot of different apps and games using python and tkinter.

Lesson Objectives –

  1. Create a Clicking App using Labels and Buttons in tkinter
  2. Using all python programming from start to finish
  3. Work with button events, windows and key binding

 

Video Tutorial

Source Code –

from tkinter import *

root = Tk()
root.geometry("300x300")
root.title("MOO ICT Button Clicker")

number = 0

# add the button function here

def ClickButton():
    global number
    number += 1
    ShowInfo["text"] = "You Clicked " + str(number) + " times."

ClickingButton = Button(root,text="Click Me!", padx=50, pady=50, bg="gold", font=("Arial, 22"), command=ClickButton)
ShowInfo = Label(root, text="message", font=("Arial, 20"), fg="purple", pady=20)

ClickingButton.pack()
ShowInfo.pack()

root.mainloop()
    



Comments are closed.