Skip to content

Commit 7079923

Browse files
committed
Create Typing-Test.py
1 parent 738a55d commit 7079923

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

Typing-Test.py

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from tkinter import *
2+
from tkinter import messagebox
3+
import random
4+
import time
5+
6+
root = Tk()
7+
root.geometry('400x210')
8+
root.title('Typing Test')
9+
10+
word_list = ['a', 'able', 'about', 'above', 'across', 'add', 'after', 'again', 'against', 'ago', 'air', 'all', 'almost', 'alone', 'along', 'already', 'also', 'although', 'always', 'am', 'American', 'among', 'an', 'and', 'animal', 'animals', 'another', 'answer', 'any', 'anything', 'are', 'area', 'around', 'as', 'asked', 'at', 'away', 'back', 'ball', 'be', 'beautiful', 'became', 'because', 'become', 'been', 'before', 'began', 'begin', 'behind', 'being', 'below', 'bet', 'better', 'between', 'big', 'black', 'blue', 'boat', 'body', 'book', 'both', 'bottom', 'box', 'boy', 'bring', 'brought', 'build', 'built', 'but', 'by', 'called', 'came', 'can', 'can\'t', 'cannot', 'car', 'care', 'carefully', 'carry', 'center', 'certain', 'change', 'check', 'children', 'city', 'class', 'close', 'cold', 'come', 'common', 'complete', 'could', 'country', 'course', 'cut', 'dark', 'day', 'deep', 'did', 'didn\'t', 'different', 'distance', 'do', 'does', 'dog', 'don\'t', 'done', 'door', 'down', 'draw', 'dry', 'during', 'each', 'early', 'earth', 'easy', 'eat', 'either', 'else', 'end', 'English', 'enough', 'even', 'ever', 'every', 'everyone', 'everything', 'example', 'face', 'fact', 'fall', 'family', 'far', 'fast', 'father', 'feel', 'feet', 'felt', 'few', 'field', 'finally', 'find', 'fine', 'fire', 'first', 'fish', 'five', 'floor', 'follow', 'food', 'foot', 'for', 'form', 'found', 'four', 'friend', 'from', 'front', 'full', 'game', 'gave', 'get', 'girl', 'give', 'glass', 'go', 'going', 'gold', 'gone', 'good', 'got', 'great', 'green', 'ground', 'group', 'grow', 'had', 'half', 'hand', 'happened', 'hard', 'has', 'have', 'he', 'head', 'hear', 'heard', 'heart', 'heavy', 'held', 'help', 'her', 'here', 'high', 'him', 'himself', 'his', 'hold', 'home', 'horse', 'hot', 'hour', 'house', 'how', 'however', 'hundred', 'I', 'I\'ll', 'I\'m', 'ice', 'idea', 'if', 'important', 'in', 'inside', 'instead', 'into', 'is', 'it', 'it\'s', 'its', 'itself', 'job', 'just', 'keep', 'kept', 'kind', 'knew', 'know', 'land', 'language', 'large', 'last', 'later', 'lay', 'learn', 'learned', 'least', 'leave', 'leaves', 'left', 'less', 'let', 'letter', 'life', 'light', 'like', 'line', 'list', 'little', 'live', 'lived', 'living', 'long', 'longer', 'look', 'low', 'made', 'main', 'make', 'man', 'many', 'map', 'matter', 'may', 'me', 'mean', 'men', 'might', 'mind', 'miss', 'money', 'moon', 'more', 'morning', 'most', 'mother', 'move', 'much', 'must', 'my', 'name', 'near', 'need', 'never', 'new', 'next', 'night', 'no', 'not', 'nothing', 'notice', 'now', 'number', 'of', 'off', 'often', 'oh', 'old', 'on', 'once', 'one', 'only', 'open', 'or', 'order', 'other', 'our', 'out', 'outside', 'over', 'own', 'page', 'paper', 'part', 'past', 'pattern', 'people', 'perhaps', 'person', 'picture', 'piece', 'place', 'plants', 'play', 'point', 'poor', 'possible', 'power', 'probably', 'problem', 'put', 'question', 'quite', 'rain', 'ran', 'read', 'ready', 'real', 'really', 'red', 'remember', 'rest', 'right', 'river', 'road', 'rock', 'room', 'round', 'run', 'sad', 'said', 'same', 'sat', 'saw', 'say', 'school', 'sea', 'second', 'see', 'seen', 'sentence', 'set', 'several', 'shall', 'she', 'ship', 'short', 'should', 'show', 'shown', 'side', 'simple', 'since', 'six', 'size', 'sky', 'small', 'snow', 'so', 'some', 'someone', 'something', 'soon', 'sound', 'space', 'special', 'stand', 'start', 'state', 'stay', 'still', 'stood', 'stop', 'story', 'strong', 'study', 'such', 'suddenly', 'summer', 'sun', 'sure', 'surface', 'system', 'table', 'take', 'talk', 'tall', 'tell', 'ten', 'than', 'that', 'that\'s', 'the', 'their', 'them', 'themselves', 'then', 'there', 'these', 'they', 'thing', 'think', 'third', 'this', 'those', 'though', 'thought', 'three', 'through', 'time', 'tiny', 'to', 'today', 'together', 'told', 'too', 'took', 'top', 'toward', 'town', 'tree', 'true', 'try', 'turn', 'turned', 'two', 'under', 'understand', 'United States', 'until', 'up', 'upon', 'us', 'use', 'usually', 'very', 'voice', 'walk', 'walked', 'want', 'warm', 'was', 'watch', 'water', 'way', 'we', 'weather', 'well', 'went', 'were', 'what', 'when', 'where', 'whether', 'which', 'while', 'white', 'who', 'whole', 'why', 'wide', 'wild', 'will', 'wind', 'winter', 'with', 'within', 'without', 'words', 'work', 'world', 'would', 'write', 'year', 'yes', 'yet', 'you', 'young', 'your']
11+
12+
new_timer = 60
13+
14+
def start():
15+
global new_timer
16+
for i in range(60):
17+
new_timer -= 1
18+
time.sleep(1)
19+
timer.configure(text=new_timer)
20+
continue
21+
22+
if len(display_word) == len(input_word):
23+
display_word.configure(
24+
text=word_list[random.randint(0, len(word_list))])
25+
26+
heading = Label(root, text='Typing Test', font=('Arial', 20, ''), justify=CENTER)
27+
heading.place(x=126, y=0)
28+
29+
timer = Label(root, text='60', font=('Arial', 14, ''), justify=CENTER)
30+
timer.place(x=187, y=40)
31+
32+
display_word = Label(root, width=20, text=word_list[random.randint(0, len(word_list))], font=('Arial', 14, ''), justify=CENTER)
33+
display_word.place(x=87, y=70)
34+
35+
input_word = Entry(root, width=10, font=('Arial', 14, ''), justify=CENTER)
36+
input_word.place(x=145, y=100)
37+
38+
timer_start = Button(root, text='Set Timer', font=('Arial', 12, ''), bd=5, command=start)
39+
timer_start.place(x=157, y=128)
40+
41+
statistics = Label(root, width=25, text='WPM:\tAccuracy:\t', font=('Arial', 14, ''), justify=CENTER)
42+
statistics.place(x=60, y=170)
43+
44+
root.mainloop()

0 commit comments

Comments
 (0)