Skip to content

Instantly share code, notes, and snippets.

@isocroft
Last active October 25, 2025 22:06
Show Gist options
  • Save isocroft/97db2e4b3a2ec6fd3ca1eaa93c74be28 to your computer and use it in GitHub Desktop.
Save isocroft/97db2e4b3a2ec6fd3ca1eaa93c74be28 to your computer and use it in GitHub Desktop.
A python cli script to that prints the lyrics to a song character by character and line by line with timer delays using an idle wait on the main thread
from time import time
import sys
def display_lyrics():
song_lyrics_with_roll_timing = [
("They say, \"the holy waters' watered down\"", 0.020),
("and this towns' lost its' faith.", 0.030),
("Our colors will fade", 0.015),
("eventually", 0.001)
]
song_lyric_line_pause = [0.2, 0.1, 0.1]
print("\n Song Title: Ordinary")
print("\n Song Owner: Alex Warren")
time.sleep(1)
for line_index, (lyric_line, lyric_line_roll_delay) in enumerate(song_lyrics_with_roll_timing):
for char in lyric_line:
print(char, end='')
sys.stdout.flush()
time.sleep(lyric_line_roll_delay)
time.sleep(song_lyric_line_pause[line_index])
if __name__ == "__main__":
display_lyrics()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment