TYPING SPEED TEST
ABSTRACT
The Typing Test project is a Python application developed using tkinter. It provides users with a
timed typing exercise to improve their typing speed and accuracy. The goal of this paper is to
create a Python based user-friendly typing speed test with user authentication. It utilizes the
Tkinter, Time, Random and RegEx libraries. Tkinter is used to create an interactive GUI. Users are
presented with a randomly selected sentence of moderate to complex difficulty, consisting of 30-50
words which must be entered accurately to measure typing speed. The time library is used to
measure the total time elapsed while typing and the regex library measures the number of words in
the sentence. This allows us to measure the user’s typing speed in words per minute (WPM). There
is also a feature which detects if a bot is attempting the test. This paper also explores the uses of
the typing speed test program in real life settings and its significance. In conclusion, the typing
speed test made using python acts as a practical tool to measure typing proficiency and prevent the
use of unfair means to get a higher speed. Users are presented with a series of words and must
type them within a 60-second time limit. At the end of the test, the application displays the number
of correct and wrong words, along with the elapsed time. This project serves as a valuable tool for
individuals seeking to enhance their typing skills and track their progress.
Keywords:
Tkinter, Accuracy, GUI (Graphical User Interface), Pygame, WPM (Words Per Minute), Typing Proficiency
INTRODUCTION
The Typing Test project is a Python application designed to help users improve their typing speed
and accuracy. It offers a timed exercise where users are given a series of words to type within a 60-
second timeframe. By practicing regularly with this typing test, users can enhance their typing skills
and measure their progress over time.
The application provides a user-friendly interface using the tkinter library. Users simply type the
presented words, and the application keeps track of the number of correct and wrong words
entered. At the end of the test, users receive feedback on their performance, including the number
of correct words, the number of mistakes, and the time taken to complete the test.
The Typing Test project is a practical tool for individuals aiming to improve their typing abilities. By
using this application, users can develop faster and more accurate typing skills, which are
increasingly important in today's digital world.
LITERATURE SURVEY
Online Resources: Explore online tutorials, documentation, and forums related to Python, Tkinter,
and QR code generation. Websites like Stack Overflow, Real Python, and Python documentation can
provide valuable information and solutions to specific coding challenges.[1]
Integrated Development Environment (IDE) or Text Editor: An IDE or text editor is used for writing
and editing the Python code. It provides features like syntax highlighting, code completion, and
debugging capabilities. Popular choices include PyCharm, Visual Studio Code, and Sublime Text.
Documentation and Tutorials: Resources like official library documentation, tutorials, and online
guides are invaluable for understanding the usage and features of the libraries you're using. They
provide code examples, explanations, and troubleshooting tips.[2]
Version Control System: Using a version control system like Git helps manage code changes,
collaborate with others, and keep track of project history.
PROPOSED SYSTEM
The proposed system is a Typing Test project aimed at improving users' typing speed and
accuracy. The system will provide a user-friendly interface for users to practice their typing
skills through timed exercises. It will display randomly generated words on the screen,
capturing user input and providing immediate feedback on typing performance. The system
will also track the number of correct and incorrect words entered by the user and display
the results at the end of the exercise.
Methodology:
Install the necessary libraries: Tkinter for GUI development and Pygame for
keyboard input and text rendering.
1. User Interface Development:
Utilize Tkinter to design an intuitive and visually appealing user interface.
Create a window to display the words and user input fields.
Implement functions for displaying words, capturing user input, and updating the interface
accordingly.
2. Word Generation and Display:
Implement a function to generate random words for each exercise.
Display the generated words on the screen using appropriate font and formatting.
3. Timing and Scoring:
Implement a timer function to track the duration of the typing test (e.g., 60 seconds).
Start the timer when the exercise begins and end it when the time limit is reached.
Capture user input during the exercise and compare it with the displayed words to
determine correctness.
Keep track of the number of correct and incorrect words entered by the user.
4. Feedback and Results:
Display immediate feedback to the user regarding correctness of typed words.
Calculate and display the final score, including the number of correct and incorrect words.
Show the elapsed time for the exercise.
5. Error Handling and Special Cases:
Handle edge cases such as empty input, special characters, and backspace handling.
Ensure the system can handle various scenarios without disrupting the overall functionality.
6. Testing and Refinement:
Conduct thorough testing to ensure the system functions as intended.
Address any identified issues or bugs to refine the system's performance and reliability.
IMPLEMENTATION
[Link]
import pygame
from [Link] import *
import sys
import time
import random
# 750 x 500
class Game:
def __init__(self):
self.w=750
self.h=500
[Link]=True
[Link] = False
self.input_text=''
[Link] = ''
self.time_start = 0
self.total_time = 0
[Link] = '0%'
[Link] = 'Time:0 Accuracy:0 % Wpm:0 '
[Link] = 0
[Link] = False
self.HEAD_C = (255,213,102)
self.TEXT_C = (240,240,240)
self.RESULT_C = (255,70,70)
[Link]()
self.open_img = [Link]('[Link]')
self.open_img = [Link](self.open_img, (self.w,self.h))
[Link] = [Link]('[Link]')
[Link] = [Link]([Link], (500,750))
[Link] = [Link].set_mode((self.w,self.h))
[Link].set_caption('Type Speed test')
def draw_text(self, screen, msg, y ,fsize, color):
font = [Link](None, fsize)
text = [Link](msg, 1,color)
text_rect = text.get_rect(center=(self.w/2, y))
[Link](text, text_rect)
[Link]()
def get_sentence(self):
f = open('[Link]').read()
sentences = [Link]('\n')
sentence = [Link](sentences)
return sentence
def show_results(self, screen):
if(not [Link]):
#Calculate time
self.total_time = [Link]() - self.time_start
#Calculate accuracy
count = 0
for i,c in enumerate([Link]):
try:
if self.input_text[i] == c:
count += 1
except:
pass
[Link] = count/len([Link])*100
#Calculate words per minute
[Link] = len(self.input_text)*60/(5*self.total_time)
[Link] = True
print(self.total_time)
[Link] = 'Time:'+str(round(self.total_time)) +" secs Accuracy:"+ str(round([Link])) + "%" + ' Wpm:
' + str(round([Link]))
# draw icon image
self.time_img = [Link]('[Link]')
self.time_img = [Link](self.time_img, (150,150))
#[Link](self.time_img, (80,320))
[Link](self.time_img, (self.w/2-75,self.h-140))
self.draw_text(screen,"Reset", self.h - 70, 26, (100,100,100))
print([Link])
[Link]()
def run(self):
self.reset_game()
[Link]=True
while([Link]):
clock = [Link]()
[Link]((0,0,0), (50,250,650,50))
[Link]([Link],self.HEAD_C, (50,250,650,50), 2)
# update the text of user input
self.draw_text([Link], self.input_text, 274, 26,(250,250,250))
[Link]()
for event in [Link]():
if [Link] == QUIT:
[Link] = False
[Link]()
elif [Link] == [Link]:
x,y = [Link].get_pos()
# position of input box
if(x>=50 and x<=650 and y>=250 and y<=300):
[Link] = True
self.input_text = ''
self.time_start = [Link]()
# position of reset box
if(x>=310 and x<=510 and y>=390 and [Link]):
self.reset_game()
x,y = [Link].get_pos()
elif [Link] == [Link]:
if [Link] and not [Link]:
if [Link] == pygame.K_RETURN:
print(self.input_text)
self.show_results([Link])
print([Link])
self.draw_text([Link], [Link],350, 28, self.RESULT_C)
[Link] = True
elif [Link] == pygame.K_BACKSPACE:
self.input_text = self.input_text[:-1]
else:
try:
self.input_text += [Link]
except:
pass
[Link]()
[Link](60)
def reset_game(self):
[Link](self.open_img, (0,0))
[Link]()
[Link](1)
[Link]=False
[Link] = False
self.input_text=''
[Link] = ''
self.time_start = 0
self.total_time = 0
[Link] = 0
# Get random sentence
[Link] = self.get_sentence()
if (not [Link]): self.reset_game()
#drawing heading
[Link]((0,0,0))
[Link]([Link],(0,0))
msg = "Typing Speed Test"
self.draw_text([Link], msg,80, 80,self.HEAD_C)
# draw the rectangle for input box
[Link]([Link],(255,192,25), (50,250,650,50), 2)
# draw the sentence string
self.draw_text([Link], [Link],200, 28,self.TEXT_C)
[Link]()
Game().run()
RESULT
CONCLUSION
In conclusion, the Typing Test project serves as a valuable platform for users to enhance their
typing speed and accuracy. Developed using Python, along with the Tkinter and Pygame libraries,
this project offers a user-friendly and interactive interface that facilitates an effective typing
practice experience.
By engaging in timed exercises with randomly displayed words, users can systematically develop
their typing skills within a specific time limit. The project provides immediate feedback on the
number of correct and incorrect words entered, enabling users to assess their performance and
monitor their progress over time. This feedback mechanism empowers individuals to identify areas
for improvement and focus on enhancing their typing accuracy and speed.
The project's emphasis on a responsive user interface ensures an engaging and seamless typing
experience. The integration of accurate word recognition and precise timing capabilities enhances
the project's functionality, allowing users to accurately measure their typing speed and
performance.
In summary, the Typing Test project offers a valuable tool for users to enhance their typing skills. By
providing a user-friendly interface, immediate feedback, and cross-platform compatibility, the
project facilitates an engaging and effective typing practice experience. Through regular
engagement with the Typing Test project, individuals can improve their typing speed, accuracy, and
overall productivity in various personal, academic, and professional endeavors.
REFERENCE
[1]Tkinter documentation: [Link]
[2]Pygame documentation: [Link]
[3]Online Tutorial:[Link]
using-tkinter
SRI VENKATESWARA UNIVERSITY COLLEGE OF
ENGINEERING TIRUPATI – 517502
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Advanced Python Program Project Report
PROJECT-1: PLAGIARISM CHECKER
PROJECT-2: PAYMENT RECEIPT GENERATOR
PROJECT-3: TYPING SPEED TEST
Submitted by
KASIREDDY CHANDANA (12116032)
KASIREDDY NANDA KUMAR REDDY (12116033)
PONNALA PAVAN SAI (12116044)
VALLETI KAVYA SREE (12116061)