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 33 34 35 36 37 38 39 40 41 42 43 44 45 | import turtle, winsound, time t=turtle.Turtle() 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 t.penup() t.goto(-250,150) t.shape('play_button.gif') t.write('Komorebi¸¦ Ç÷¹ÀÌÇÏ·Á¸é K \nNew_Land¸¦ Ç÷¹ÀÌÇÏ·Á¸é N \nSt_Francis¸¦ Ç÷¹ÀÌÇÏ·Á¸é S¸¦ ÀÔ·Â Çϼ¼¿ä.', font=('¹ÙÅÁ', 20, 'bold')) t.goto(0,0) t.goto(-50,0) def play_K() : winsound.PlaySound(songs[0], flags) t.goto(-50,0) t.setheading(0) while True: t.forward(100) t.left(180) def play_N() : winsound.PlaySound(songs[1], flags) t.goto(-50,0) t.setheading(0) while True: t.forward(100) t.left(120) def play_S() : winsound.PlaySound(songs[2], flags) t.goto(-50,0) t.setheading(0) while True: t.forward(100) t.left(90) s.onkeypress(play_K, "K") s.onkeypress(play_N, "N") s.onkeypress(play_S, "S") s.listen() | cs |