def play_complicated(paths):
 my_paths = copy.copy(paths)
 def next_song():
  my_paths.pop(0)
  p.play_file(my_paths[0])
 p = GstPlayer(next_song)
 p.run()
 p.play_file(my_paths[0])
 while my_paths:
  time.sleep(1)

def play_complicated ( paths ) : my_paths = copy . copy ( paths ) def next_song ( ) : my_paths . pop ( 0 ) p . play_file ( my_paths [ 0 ] ) p = GstPlayer ( next_song ) p . run ( ) p . play_file ( my_paths [ 0 ] ) while my_paths : time . sleep ( 1 )
play the files in the path one after the other by using the callback function to advance to the next song .