[Python] Text Change Event

 



from tkinter import *

# Tkinter 인스턴스 생성
win = Tk()

# Window 사이즈 지정
win.geometry("700x350")

# Text 변경 Function 정의
def on_click():
label["text"] = "Python"
b["state"] = "disabled"

# Label 생성
label = Label(win, text="Text",
font=('Calibri 15 bold'))
label.pack(pady=20)

# 버튼 생성
b = Button(win, text="Update Text", command=on_click)
b.pack(pady=20)

win.mainloop()

댓글

이 블로그의 인기 게시물

[Python] Tkinter를 활용한 Text Console 출력

[Python] Tkinter를 활용하여 Text 강조(Highlight)하기

[Python] Tkinter를 활용하여 Entry 값 계산하여 Label에 출력