Skip to content

Instantly share code, notes, and snippets.

@robinkaty
Last active September 14, 2023 22:03
portable_alert_sounds.py
import platform
def beephappy():
if platform.system() == "Windows":
import winsound
winsound.Beep(1998, 500)
elif platform.system() == "Darwin":
import os
os.system("afplay /System/Library/Sounds/Tink.aiff")
elif platform.system() == "Linux":
import os
os.system("beep")
def beepsad():
if platform.system() == "Windows":
import winsound
winsound.Beep(1000, 200)
winsound.Beep(500, 200)
winsound.Beep(1000, 200)
winsound.Beep(500, 200)
winsound.Beep(1000, 200)
elif platform.system() == "Darwin":
import os
os.system("afplay /System/Library/Sounds/Basso.aiff")
elif platform.system() == "Linux":
import os
os.system("beep")
os.system("beep")
os.system("beep")
if __name__ == "__main__":
# beephappy()
beepsad()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment