Skip to content

Instantly share code, notes, and snippets.

@XChrisUnknownX
Created July 12, 2019 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XChrisUnknownX/c0cb1d924d98191eb6b068084715ff6c to your computer and use it in GitHub Desktop.
Save XChrisUnknownX/c0cb1d924d98191eb6b068084715ff6c to your computer and use it in GitHub Desktop.
Trying to stream a custom stream at the user’s custom WPM
import time
import random
ptest = input("Characters to stream: ")
wordslist = ptest.split()
characters = len(ptest)
words = len(wordslist)
while True:
wordspermin = input("Enter desired words per minute: ")
try:
wordspermin = int(wordspermin)
except:
print("Bad value entered. Defaulting to 180 words per minute.")
wordspermin = 180
break
minutes = words / wordspermin
seconds = minutes / 60
wps = wordspermin / 60
avgcharactersperword = characters / words
newwords = characters / avgcharactersperword
newwps = newwords / 60
characterspersecond = characters / seconds
stream =
for i in ptest:
print(i,end="",flush=True)
time.sleep(stream)
print()
input("Program ended. Press enter to exit.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment