Python Forum
Accurate Clicks Per Second
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accurate Clicks Per Second
#6
Hello. This seems related to my issue. I need to submit a project in python (which I am not really good at). I am looking to replicate something like ... So far, I took help from a few forums and have reached up to this -

import tkinter as tk
from tkinter import ttk


count = 0

def clicked(): # without event because I use `command=` instead of `bind`
    global count

    count = count + 1

    label1.configure(text=f'Button was clicked {count} times!!!')


windows = tk.Tk()
windows.title("My Application")

label = tk.Label(windows, text="Hello World")
label.grid(column=0, row=0)

label1 = tk.Label(windows)
label1.grid(column=0, row=1)

custom_button = ttk.Button(windows, text="Click on me", command=clicked)
custom_button.grid(column=1, row=0)

windows.mainloop()
Now, I am able to count the clicks succesfully... but don't know how to add a timer to it. I need a simple 10 sec countdown timer after which the click counting should stop.

Can someone please help add the code to this? it'll really help me pass in this project. TIA.
Larz60+ write Mar-20-2022, 06:10 PM:
Link removed for same reason shown in post 5
Reply


Messages In This Thread
Accurate Clicks Per Second - by JudyLarose - Jun-13-2020, 01:48 PM
RE: Accurate Clicks Per Second - by michael1789 - Jun-13-2020, 05:06 PM
RE: Accurate Clicks Per Second - by Windspar - Jun-13-2020, 09:29 PM
RE: Accurate Clicks Per Second - by JudyLarose - Jun-14-2020, 05:04 AM
RE: Accurate Clicks Per Second - by buran - Jun-14-2020, 05:49 AM
RE: Accurate Clicks Per Second - by maxwilson - Feb-09-2021, 07:33 PM
RE: Accurate Clicks Per Second - by deanhystad - Feb-09-2021, 09:03 PM
RE: Accurate Clicks Per Second - by maxwilson - Feb-10-2021, 02:54 AM
RE: Accurate Clicks Per Second - by deanhystad - Feb-10-2021, 03:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Accurate Clicks Per Second Hamti 6 6,025 May-18-2024, 06:24 AM
Last Post: wordtime
  [split] Accurate Clicks Per Second kathyalex 4 4,362 Feb-16-2021, 04:27 PM
Last Post: SheeppOSU
  help with python mouse clicks and Pygame programmer229193 5 4,950 May-05-2020, 04:15 PM
Last Post: Windspar
  [PyGame] How would I make my position variable more accurate? HelpMEE 4 4,122 Dec-31-2019, 02:31 AM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020