1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from tkinter import * from tkinter import messagebox # ÇÔ¼ö¼±¾ð def keyEvent(event) : if(event.char == "c") : lbl["image"] = img_cat elif(event.char == "d") : lbl["image"] = img_dog window = Tk() window.geometry("400x300") window.title("Űº¸µå Ű") window.bind("<Key>", keyEvent) img_cat = PhotoImage(file='°í¾çÀÌ.png') img_dog = PhotoImage(file='°³.png') lbl = Label(window, text="Űº¸µå <c>: °í¾çÀÌ \nŰº¸µå <d>: °³ ", font="±¼¸² 20 bold", fg="yellow", bg="black") lbl.place(x = 50, y = 50) window.mainloop() | cs |