Tkinter demo to use countdown timer to check typing speed of user by using threading

preview_player
Показать описание
When we execute any function or process the system stops all other process till the main process is over. This will create problem as we have to wait till the main process is over. Some time we have to create a count down process to monitor any activity and then use the same to terminate or start the other sub process. For this requirement we have to use Threading.
Threads are used to allow different sub process to operate in parallel. This demo shows how it can be used to monitor the entry of chars in the Entry box for 5 seconds. After 5 seconds the entry id disabled and the number of chars entered by user is displayed.
For this we start a different thread which runs the countdown process and allow or stop the data entry by user.
This script is further improved by adding random string generator where user has to enter the string as shown. If the user entered string matches the random string then number of chars completed is added to score and a fresh string is shown.

To check the user entered string, keyrelease event is tracked and the function is executed to check the user entered string with the matching string.

Copy the full source code from here.

#threadingTkinter #typeingSpeed #tkinterThread #startThread #python #plus2net #onkyeup #speedtest
Рекомендации по теме