To play sound on a Tkinter application you can use the module winsound. This module however works only on Windows computers. If you want to be more cross platform you can just combine Tkinter and PyGame ...
# play a sound on key press
from Tkinter import *
from pygame import mixer
# detect any normal key press (0..9, A..Z, a..z)
if event.char == event.keysym:
if event.char == '1':
# play the sound instance
if event.char == '2':
prompt = 'Press key 1 or 2 to play a sound'
# initialize the pygame mixer
# pick sounds you have ...
# copy to working directory or indicate full path
# create the sound instances
d1 = mixer.Sound("boing.wav")
d2 = mixer.Sound("beep.wav")
prompt = "Error: Sound file not found"
root = Tk()
label1 = Label(root, text=prompt, width=len(prompt), bg='yellow', fg='red')
# start the event loop
I am working creating a fully encapsulated, homogeneous singly linked data structure. The Listing class and SinglyLinkedList class that are part of the whole application compile fine, but the problem ...