Automatically play sound in IPython notebook

后端 未结 7 1463
夕颜
夕颜 2020-12-08 02:01

I often run long-running cells in my IPython notebook. I\'d like the notebook to automatically beep or play a sound when the cell is finished executing. Is there some way to

相关标签:
7条回答
  • 2020-12-08 03:00

    You could use an external module with python. Try adding this s.play() call from Snack Sound Toolkit at the end of the cell.

    The Snack Sound Toolkit can play wav, au and mp3 files.

    s = Sound() 
    s.read('sound.wav') 
    s.play()
    

    this question is basically a duplicate of: Play a Sound with Python.

    The above code-snipit was from @csexton in that question.

    0 讨论(0)
提交回复
热议问题