r/learnpython • • Oct 02 '26

Slow print for text-based game

I am trying to make a text-based adventure game in Python, how do I make it so the text is typed out slowly and not instantly? I've tried ways online, but they keep returning None at the end. How do I fix this?

0 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/white_nerdy Oct 04 '26

sleep is provided by time so you need to say from time import sleep at the top of your program for this to work.

Also flush=True is very important, Python by default doesn't send the text you print() to the OS until the end of a line.

1

u/AmanBabuHemant Oct 04 '26

sleep is provided by time so you need to say from time import sleep at the top of your program for this to work.

well, to make this program work you also have to call this function, right?

It's just the snippet...

Also flush=True is very important, Python by default doesn't send the text you print() to the OS until the end of a line.

snippet already have flush=True, isn't it?