How to print 1 letter at a time.
Hi, I want to print one letter at a time with an interval of 0.3 seconds on the same line. How am I supposed to implement it in my program. I appreciate your kind help.
here is a better way of doing it:
First the imports:
import sys, os import time
And this is the code:
st = 0.03 def sp(str): for letter in str: sys.stdout.write(letter) sys.stdout.flush() time.sleep(st) print()
I usually put it at 0.04 because it prints it not too fast and not too slow. But you can change it. Just change the value after
Each time you want to do this typewriter effect, just do:
(outputted one char at a time)
this is from my tutorial here ;)