MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / slowPrint

Function slowPrint

src/gamesbyexample/alphabetizequiz.py:63–69  ·  view source on GitHub ↗

Slowly print out the characters in text one at a time.

(text, pauseAmount=0.1)

Source from the content-addressed store, hash-verified

61
62
63def slowPrint(text, pauseAmount=0.1):
64 """Slowly print out the characters in text one at a time."""
65 for character in text:
66 # Set flush=True here so the text is immediately printed:
67 print(character, flush=True, end='') # end='' means no newline.
68 time.sleep(pauseAmount) # Pause in between each character.
69 print() # Print a newline.
70
71
72# If this program was run (instead of imported), run the game:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected