Skip to content

Instantly share code, notes, and snippets.

View EppuHeilimo's full-sized avatar

Eppu Heilimo EppuHeilimo

View GitHub Profile
@parente
parente / README.md
Last active September 14, 2023 13:25
Jupyter Tidbit: Run and say "done!"

Summary

Many modern web browsers provide a speech synthesis API for JavaScript. You can write and invoke a function to have your notebook speak when it finishes executing certain cells, whether you're running it in JupyterLab (>=0.34) or classic Jupyter Notebook.

def speak(text):
    from IPython.display import Javascript as js, clear_output
 # Escape single quotes