Skip to content

Instantly share code, notes, and snippets.

@sdushantha
Last active December 16, 2018 14:14
Show Gist options
  • Save sdushantha/7242c4c2fc0fe05a7ff20d02b8b94bce to your computer and use it in GitHub Desktop.
Save sdushantha/7242c4c2fc0fe05a7ff20d02b8b94bce to your computer and use it in GitHub Desktop.
Script to cheat on TypingPal
from time import sleep
from pyautogui import press
import re
import sys
def cleanhtml(raw_html):
cleanr = re.compile('<.*?>')
cleantext = re.sub(cleanr, '', raw_html)
return cleantext
fname = input("File name: ")
f = open(fname)
print("Reading file...")
ex1 = cleanhtml(f.read())
ex1 = ex1.replace("&nbsp;", " ")
if ";" in ex1:
print("Sorry, this script cant do exercises with semicolons")
sys.exit()
print("Cleaned the html")
sleep(5)
for letters in ex1:
press(letters)
print(letters)
print("--COMPLETED--")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment