The “Typing Tutor Pro” project is a user-friendly typing tutor application designed to enhance users’ typing speed and accuracy. The application provides an engaging platform for users to practice their typing skills with randomly generated text snippets. Users are presented with a variety of text prompts, ranging from insightful quotes to interesting facts, to type within a 60-second time limit. After the exercise, “Typing Tutor Pro” calculates the user’s typing speed in Words Per Minute (WPM) and displays the results, allowing users to track their progress over time. The project aims to serve a diverse audience, including students, professionals, and individuals looking to improve their typing proficiency. Using Python and the Tkinter library for the graphical user interface, “Typing Tutor Pro” offers a simple and effective solution for enhancing typing skills. The project’s future enhancements may include adjustable timers, gamification elements, and challenges to further engage and motivate users.

from tkinter import *
from tkinter import ttk
import time
import random

typing_text = [
    'In the heart of the city, a bustling market comes alive every morning...',
    'The old oak tree stood tall in the middle of the forest, its branches reaching out like gnarled fingers...'
    'In a bustling city square, a diverse group of people gathered, representing different cultures and backgrounds. Laughter, conversation, and the sharing of food created a mosaic of human connection. It was a celebration of unity in diversity.'
    'In a library, rows of books awaited eager readers. The scent of aged pages and leather-bound volumes filled the air. Each book was a gateway to a different world, a treasure trove of knowledge and imagination.',
    'As the sun set over the horizon, the beach transformed into a tranquil paradise. Waves gently lapped at the shore, and the sky was painted in shades of orange and pink. It was a moment of pure beauty.',

]

root = Tk()
frm = ttk.Frame(root, padding=10)

start_time = None
typed_text = ""

def start_typing_timer():
    global start_time
    start_time = time.time()
    input_field.delete(0, END)  # Clear the input field
    num = random.randrange(len(typing_text))
    T.delete(1.0, END)  # Clear the previous text in the text widget
    T.insert(END, typing_text[num])
    input_field.config(state="normal")  # Enable input
    root.after(10000, stop_typing_timer)  # Schedule stop_typing_timer to run after 60 seconds

def stop_typing_timer():
    global start_time, typed_text
    if start_time:
        elapsed_time = time.time() - start_time
        typed_text = input_field.get()
        word_count = len(typed_text.split())
        typing_speed = int((word_count / (elapsed_time / 60)))
        result_label.config(text=f"Your typing speed: {typing_speed} WPM")
        input_field.delete(0, END)  # Clear the input field
        input_field.config(state="disabled")  # Disable input
        start_time = None

def quit_app():
    root.destroy()

frm.grid()

ttk.Label(frm, text='Type as much as you can in 60 seconds and see your typing speed!').grid(column=0, row=0)

input_field = ttk.Entry(frm, state="disabled")
input_field.grid(column=0, row=1)

start_button = ttk.Button(frm, text='Start Typing', command=start_typing_timer)
start_button.grid(column=0, row=2)

result_label = ttk.Label(frm, text="")
result_label.grid(column=0, row=4)

quit_button = ttk.Button(frm, text='Quit', command=quit_app)
quit_button.grid(column=0, row=5)

T = Text(frm, height=6, width=50)
T.grid(row=3, column=0, columnspan=3)

root.mainloop()

Python Projects : Python based Typing tutor

For further practice and challenge you can try this next level

Python project : Typing Tutor Next level

Leave a Reply

Your email address will not be published. Required fields are marked *