Python Graphical Programming examples

Source: Internet
Author: User
# 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:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.