Python
Python
INTRODUCTION:
Typing tests are used to measure how quickly and accurately you can type in a given amount of
time. Speed and accuracy are the key factors for determining your WPM (words per minute).
Once a passage is presented, candidates have a given amount of time to type the passage as
quickly and accurately as possible.
Typing tests simply measure your typing speed and accuracy. Typing tests are frequently used as a
part of the recruitment process for clerical and administrative positions and are used extensively
when assessing candidates for data entry, typist, and transcriptionist jobs.
Typing Tester 1
COMPUTER ENGINEERING VVIT PAL
FILE USED:
tkinter-
Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI
toolkit, and is Python's de facto standard GUI
random-
Python Random module is an in-built module of Python that is used to generate random numbers
in Python. These are pseudo-random numbers ...
default_timer -
The argument is the number of times through the loop, defaulting to one million. The main
statement, the setup statement and the timer function to be used are ..
difflib-
Difflib is a built-in module in the Python programming language consisting of different simple
functions and classes that allow users to compare data sets
Check():
We are using the default_timer function from the timeit module to calculate the time taken and then
we are using a round function to round it to two decimal places.
We are calculating the speed using the formula (len(word) / time taken). It then checks the entered
string with the current string and if both the strings do not match, it displays the time taken to type
the given string, accuracy, and speed. To calculate accuracy we are using difflib’s SequenceMatcher
function.
Typing Tester 2
COMPUTER ENGINEERING VVIT PAL
CODING
import random
import difflib
root=Tk()
root.geometry("400x400")
entered=StringVar()
greet.grid(row = 0,columnspan = 3)
words=['We are developing Python project', 'This is Windows Os', 'We are Hiring', 'Lets Play a
game','Python is a programming language', 'We love Coding', 'This is an amazing Article', 'I am an
Intern', 'Lets check the Output', 'we are Compiling this program' ]
word=random.choice(words)
def check():
global entered
global word
global start
string=f"{entered.get()}"
end= default_timer()
time= round(end-start,2)
print(time)
Typing Tester 3
COMPUTER ENGINEERING VVIT PAL
speed=round(len(word.split())*60/time,2)
print(speed)
if string==word:
else:
accuracy=difflib.SequenceMatcher(None,word,string).ratio()
accuracy=str(round(accuracy*100,2))
Msg3= " Speed= " + str(speed) + ' wpm' #words per minute
label.grid(row = 7, columnspan = 3)
label.grid(row = 8, columnspan = 3)
label.grid(row = 9, columnspan = 3)
def play():
global word
global start
global entered
label.grid(row = 5, column=1)
entered=StringVar()
Typing Tester 4
COMPUTER ENGINEERING VVIT PAL
enter.grid(row=5,column=3)
btn.grid(row = 6,columnspan = 6)
label.grid(row = 3, columnspan = 3)
btn.grid(row = 4,columnspan = 6)
start= default_timer()
mainloop()
Typing Tester 5
COMPUTER ENGINEERING VVIT PAL
OUTPUT:
Typing Tester 6
COMPUTER ENGINEERING VVIT PAL
CONCLUSION:
The Typing Test measures an individual's typing speed and accuracy. The test-taker is
presented with a passage and given one minute to type as much of the passage as possible. The
test generates three scores: Words per Minute (WPM), Number of Errors, and Adjusted Words per
Minute (WPM - Errors).
We have implemented the python typing speed test successfully. GUI application
development in python is fun. Tkinter provides most of the functionalities as pre-built. We hope
now you have a clear understanding of random(), default_timer() functions, and Tkinter.
Typing Tester 7
COMPUTER ENGINEERING VVIT PAL
REFERENCE:
https://projectgurukul.org/python-project-typing-speed-test/
Typing Tester 8