Help - I give up - when I try to run the following code I get this message - thanks in advance for any information you can provide.
Traceback (most recent call last):
File "C:/Head First Programming/pySounds.py", line 1, in <module>
import pygame.mixer
ImportError: No module named 'pygame'
I made sure the python program is in the same directory as the pygame folder - I checked and the file mixer.h is in the pygame folder so I am not sure why it is not found. Is there something that I must do since this is a .h file?
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
Here is the code from page 221 in the Head First Programming book:
import pygame.mixer
# from pygame import mixer
sounds = pygame.mixer
sounds.init()
def wait_finish(channel):
while channel.get_busy():
pass
s = sounds.Sound("heartbeat.wav")
wait_finish(s.play())
s2 = sounds.Sound("buzz.wav")
wait_finish(s2.play())
s3 = sounds.Sound("ohno.wav")
wait_finish(s3.play())
s4 = sounds.Sound("carhorn.wav")
wait_finish(s4.play())











