from tkinter import * class mDialog : def __init__ ( self , master ): frame = Frame ( master ) frame . pack () #출력을 위한 Text 위젯 self . textbox = Text ( frame , width = 50 , height = 5 ) self . textbox . grid ( row = 0 , columnspan = 2 ) #한줄 입력을 위한 위젯, Entry self . input = Entry ( frame , width = 50 ) self . input . grid ( row = 1 , column = 0 ) self . button = Button ( frame , text = "입력" , command = self . output ) self . button . grid ( row = 1 , column = 1 ) def output ( self ): #Entry.get() #입력받은 내용을 출력 self . textbox . insert ( END , self . input . get ()) def main (): root = Tk () app = mDialog ( root ) root . mainloop () if __name__ == '__main__' : main ()