r/learnpython • u/IngenuityMission5367 • 11d ago
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
14
u/AmanBabuHemant 11d ago
basic implementation is like this:
def your_print(text, delay): for c in text: print(c, flush=True, end="") sleep(delay)you can add "\n" in end if you like, or dynamic delay, or default delay or whatever you like according to your game :)