how to i use check button to show the snap
<p><strong>My program is designed to:</strong></p>

<ul>
<li><p>Initially, the Label shows nothing (i.e., it is empty).</p></li>
<li><p>Any number of the Checkbuttons may be selected by the user.</p></li>
<li><p>Any selected Checkbuttons may be unselected by the user.</p></li>
<li><p>When any two Checkbuttons are selected, the Label shows "Snap".</p></li>
<li><p>When any other number of Checkbuttons is selected, the Label shows
nothing (i.e., it is empty).</p></li>
</ul>

<p><strong>This is my code, so far</strong></p>

<pre><code>display = ScrolledText(the_window,font=('Arial',24),width =10,height =2,
                       borderwidth=2,relief='groove')
display.place(x=80,y=7)

def display_snap():
    display.insert(END,'Snap')
    if display_snap

checkbox = Checkbutton(the_window,command = display_snap)
checkbox.place(x=10,y=80)

checkbox2 = Checkbutton(the_window)
checkbox2.place(x=60 , y=80)

checkbox3 = Checkbutton(the_window)
checkbox3.place(x=110 , y=80)

checkbox4 = Checkbutton(the_window)
checkbox4.place(x=160 , y=80)

checkbox5 = Checkbutton(the_window)
checkbox5.place(x=210 , y=80)
</code></pre>

<p>It looks like you're using Tkinter. As the <a href="http://effbot.org/tkinterbook/checkbutton.htm" rel="nofollow">Tkinter docs</a> say "each Checkbutton widget should be associated with a variable". You can detect whether the widget is selected or not by using the <code>.get()</code> method of the variable: a value of 0 means the button is unselected, 1 means it's selected.</p>

<p>Here's a simple program that stores the buttons' variables in a list. We can then use the built-in <code>sum</code> function to count how many buttons are selected, and update the text of the Label widget accordingly.</p>

<pre><code>import tkinter as tk

root = tk.Tk()

label = tk.Label(root, text='')
label.grid(row=0, column=0, columnspan=5)

def set_snap():
    text = 'Snap' if sum(v.get() for v in states) == 2 else ''
    label.config(text=text)

states = []
for i in range(5):
    var = tk.IntVar()
    states.append(var)
    cb = tk.Checkbutton(root, variable=var, command=set_snap)
    cb.grid(row=1, column=i)

root.mainloop()
</code></pre>

<p>The above code is for Python 3. To run it on Python 2, just change the <code>import</code> line to</p>

<pre><code>import Tkinter as tk
</code></pre>

python tkinter