728x90
tkinter
-
tkinter - TextPython 2021. 4. 1. 00:28
Text을 이용하여 여러 줄의 문자열을 입출력하는 위젯 Text 사용 from tkinter import * win = Tk() text = Text(win) text.insert("current", "안하세요.") text.insert(2.1, "녕") text.pack() text.tag_add("강조", "1.0", "1.6") text.tag_config("강조", background="yellow") text.tag_remove("강조", "1.1", "1.2") win.mainloop() Text Method 기능 설명 insert(index, "문자열") 문자열 삽입 index 위치에 문자열 삽입 delete(start_index, end_index) 문자열 삭제 start_index 부터 ..