1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | import turtle, winsound, time s=turtle.Screen() s.addshape('play_button.gif') songs = ['Komorebi.wav', 'New_Land.wav', 'St_Francis.wav'] flags = winsound.SND_FILENAME| winsound.SND_ASYNC | winsound.SND_NODEFAULT slist = [] for n in range(3): t= turtle.Turtle() t.shape('play_button.gif') slist.append(t) def play1(x, y) : winsound.PlaySound(songs[0], flags) def play2(x, y) : winsound.PlaySound(songs[1], flags) def play3(x, y) : winsound.PlaySound(songs[2], flags) plist = [play1, play2, play3] n=0 for t in slist : t.up() t.goto(-200+n*200,0) t.color('red') t.write(songs[n]) time.sleep(1) t.onclick(plist[n]) n += 1 | cs |