Sound alarm when code finishes
I am in a situation where my code takes extremely long to run and I don't want to be staring at it all the time but want to know when it is done. How can I make the (Python) code sort of sound an "alarm" when it is done? I was contemplating making it play a .wav file when it reaches the end of the code... Is this even a feasible idea? If so, how could I do it? Ryan Saxe On Windows import winsound duration = 1000 # milliseconds freq = 440 # Hz winsound.Beep(freq, duration) Where freq is the frequency in Hz and the duration is in milliseconds. On Linux and Mac import os duration = 1 # seconds