Skip to content

Instantly share code, notes, and snippets.

@recklessop
Created January 16, 2019 17:17
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 recklessop/9fdb716dfc890f77bb64dc3bca781959 to your computer and use it in GitHub Desktop.
Save recklessop/9fdb716dfc890f77bb64dc3bca781959 to your computer and use it in GitHub Desktop.
import sys,time,random
def print_slow(str):
for letter in str:
sys.stdout.write(letter)
sys.stdout.flush()
time.sleep(0.1)
print_slow("Type whatever you want here")
@tntgamer685347
Copy link

hi, i want to find a way to use a normal print statement like this:
"""
def type(text, typing_speed):
for char in text:
print(char, end='')
time.sleep(10.0/typing_speed)
print('\n')
"""

could you maybe try to help me?
and also i would recommend after the for loop to put a print statement so i goes into the next line.

@tntgamer685347
Copy link

i found how to do it:
"""
def slowType(self, text):
typing_speed = 50
for char in text:
print(char, end='', flush=True)
time.sleep(10.0/typing_speed)
"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment