How Do I make a sentence letter by letter?
How Do I make a sentence letter by letter? For example: you typing "Hello World!"
SilvermoonCat
Hi! I know this has been answered but (in my opinion) there's an easier way-
import time, sys def typing(text): for char in text: sys.stdout.write(char) sys.stdout.flush() time.sleep(0.043) # You can adjust speed print("") # new line typing("Hello World!")
xxpertHacker
If you want a more "human" type-writer effect, you might want to add a bit of randomization to the timing of the accepted answer.
Kai_Justice
import time def slowType(txt: str, buff: float = 0.5): # 'txt' is what you want to type out, 'buff' is the time between each letter for index, char in enumerate(txt): print(char, end="" if index+1 < len(txt) else "\n", flush=True) time.sleep(buff)
Usage: slowType("Hello world!", 0.03)
lsikora
What do you mean by letter by letter? What language? If you want to say hello world, you say...
print("Hello World!")
lsikora
This is python btw @CodeMaster007
P0GCHAMPB0i
@CodeMaster007 yeah but like when you type it it geos a sigle letter then another single letter
P0GCHAMPB0i
@CodeMaster007 Yea python
Oh you mean type writer effect:
Is this what you wanted? Let me know! :D
@Bookie0 ok i will try
@Bookie0 TYYYY
cool @B1gB0i
@B1gB0i np, glad it helped! :)
@Bookie0 yee
@Bookie0 e
yes @B1gB0i
@Bookie0 https://www.youtube.com/watch?v=a8c5wmeOL9o
@Bookie0 https://www.youtube.com/watch?v=sXwaRjU7Tj0
@Bookie0 lol these to videos are good click this one first: https://www.youtube.com/watch?v=dQw4w9WgXcQ
@B1gB0i they are obv rick rolls
@Bookie0 yup
@Bookie0

lol @B1gB0i
@Bookie0 https://www.youtube.com/watch?v=a8eU6hTAHEE
@Bookie0 eee get rickrolled
@Bookie0 ahh lets not get off topic
@B1gB0i ok i think that's enough lol ;)
@Bookie0 yup (sorry for all of these pings)