# Coding=utf-8 Import tkinter as TK import time Def processbutton (): if V1.get () = 1: #print text.get ("0.0 "," End ") # t= Text.get (" 0.0 "," 2.0 ") #print t window2 = tk. TK () # Create a window window2.title ("result") # set the title Text2 = Tk. Text (Window2) Text2.pack () Text2.insert ("End", ' t1\n ') text2.insert (' End ', ' R1 ') #text2. SERT (' End ', T) else:t=text.get ("0.0", "end") Window2 = Tk. TK () # Create a window window2.title ("result") # set the title Text2 = Tk. Text (Window2) text2.pack () time.sleep text2.insert (' End ', ' T1 ' + ' \nr2 ' + ' \nt2 ' + ' \nr2 ') window = Tk. TK () # Create a window Window.title ("Demo") # set the title frame1 = Tk. Frame (window) # Create a Frame Frame1.pack () # Place the Frame frame1 in window Text = tk. Text (window) text.pack () V1 =tk. Intvar () Rbdanju = Tk. Radiobutton (frame1, text= "Analysis of simple Sentences", Variable=v1, value=1,) Rbpiliang =TK. RadiobuttOn (frame1, text= "Batch Analysis", Variable=v1, value=2,) Rbfenxi = tk . Button (frame1, text= "Analysis", command = Processbutton) # Grid Layout Rbdanju.grid (row=1, Column=1) Rbpiliang.grid (Row=1, CO lumn=2) Rbfenxi.grid (row=1,column=3) frame2 =tk. FRAME (window) # Create frame frame2 frame2.pack () # Place frame2 in Window # Create message L1=TK. Label (frame2, text= "Simple analysis only the first line of text analysis, justify= ' left ') # Grid layout L1.grid (STICKY=TK. E) # Monitor events until window is closed Window.mainloop () v1 =tk. Intvar () Rbdanju = Tk. Radiobutton (frame1, text= "Analysis of simple Sentences", Variable=v1, value=1,) Rbpiliang
=tk. Radiobutton (frame1, text= "Batch Analysis", Variable=v1, value=2, ) Rbfenxi = Tk. Button (frame1, text= "Analysis", command = Processbutton) # Grid Layout Rbdanju.grid (row=1, Column=1) Rbpiliang.grid (Row=1, CO lumn=2) Rbfenxi.grid (row=1,column=3) frame2 =tk. FRAME (window) # Create frame frame2 FRame2.pack () # Places frame2 in Window # creates message l1=tk. Label (frame2, text= "Simple analysis only the first line of text analysis, justify= ' left ') # Grid layout L1.grid (STICKY=TK.
E) # Monitor events until window is closed Window.mainloop ()
Graphical interface: