title: How do I repeat music using pygame.mixer?
body: <p>I have created the following code that plays mp3 music using pygame.mixer. However, the music does not repeat. Any idea's on how I would make it so that the music does repeat? Here is the code:</p>
  
  <pre><code>playlist = list()
  playlist.append ( "put music here.mp3" )
  playlist.append ( "put music here.mp3" )
  
  pygame.mixer.music.load ( playlist.pop() )  
  pygame.mixer.music.queue ( playlist.pop() )
  pygame.mixer.music.set_endevent ( pygame.USEREVENT )  
  pygame.mixer.music.play()           
  
  a = 0
  
  running = True
  while a == 0:
     while running:
        for event in pygame.event.get():
           if event.type == pygame.USEREVENT:    
              if len ( playlist ) &gt;1:       
                 pygame.mixer.music.queue ( playlist.pop() )`
  </code></pre>