Update typing_speed_test.py#75
Merged
FOSSCLUB-LBSITW merged 2 commits intoMar 13, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
Brief description of what this PR does.
Adds a live, continuously updating WPM counter displayed alongside the
countdown timer during an active typing test. The WPM refreshes every 1 second
via a scheduled
self.after(1000, self.update_live_wpm)loop, providingreal-time feedback similar to Monkeytype and 10fastfingers.---
🔗 Related Issue
Closes: #65
Changes Made
New UI Elements
self.stats_framectk.CTkFrame(transparent)self.live_wpm_labelctk.CTkLabelstats_frame, shows⌨ Live WPM: XX.XXNew Methods
calculate_current_wpm()float. Used by both the live loop and final result.update_live_wpm()self.after(1000, ...)) that callscalculate_current_wpm(), updateslive_wpm_labeltext and color. Runs only whiletimer_running is Trueandpaused is False.New Instance Variable
self.live_wpm_after_idstr | Noneafter()ID for the live WPM loop so it can be cancelled on pause/completionColor-Coded Live WPM Feedback
#00AA00#CC8800#CC0000#0055CC#555555Modified Methods
begin_test()self.update_live_wpm()to start the live loop alongside the timertoggle_pause()live_wpm_after_idon pause; restartsupdate_live_wpm()on resumecheck_result()live_wpm_after_id; usescalculate_current_wpm()for final WPM; updates live label to show "Final WPM" in bluestart_test()on_duration_change()Layout Changes
self.timer_labelpacked standaloneself.stats_frame(transparent frame) holdstimer_label(col 0) andlive_wpm_label(col 1) in a grid750×680750×720(extra height for stats row)No Changes To
TEXT_POOLS,DURATION_OPTIONS,TEXT_LENGTH_OPTIONS— unchangedshow_countdown()— unchangedhandle_typing()— unchanged (live WPM is interval-based, not keystroke-based)update_sentence_display()— unchangedupdate_streaks()— unchangedload_data()/save_data()— unchangedstreak_data.jsonschema — unchangedbeep()wrapper — unchangedWhy Interval-Based (Not Keystroke-Based)
<KeyRelease>)self.after(1000, ...))Chosen: Interval-based (1 second) — consistent with how Monkeytype and
10fastfingers render live WPM.
📷 Screenshots (if applicable)
✅ Checklist