Created
July 8, 2019 05:32
-
-
Save timkent/b893a0eb48c6a5517c07c0c59d5ac83d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import keyboard | |
| import winsound | |
| woof_keys = 'puy' | |
| meow_keys = 'elachoe' | |
| def play_quack(key): | |
| if key.name in meow_keys: | |
| winsound.PlaySound('cat_meow2.wav', winsound.SND_ASYNC) | |
| elif key.name in woof_keys: | |
| winsound.PlaySound('dog_bark_x.wav', winsound.SND_ASYNC) | |
| else: | |
| winsound.PlaySound('Quack.wav', winsound.SND_ASYNC) | |
| keyboard.on_press(play_quack) | |
| keyboard.wait() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment