title: Tkinter get selected value of a CheckButton
body: <p>I have tried several <a href="https://stackoverflow.com/questions/16778424/python-if-checkbutton-is-selected">examples from stackoverflow</a>, but didn't work for me unfortunately.</p>
  
  <p>I just want to get the value of selected checkButton of Tkinter, Python.</p>
  
  <p>I have a list of CheckButton and its like below</p>
  
  <pre><code>## csv file has rows like
  # 101, apple
  # 102, orange
  for row in csvReader:
          checkButton = Checkbutton(top, text = row[1], variable = StringVar(), 
                   onvalue = row[0], offvalue = "0", height=2, \
                   width = 0, justify=Tkinter.LEFT)
          checkButton.pack()
          checkBoxList.append(checkButton)
  </code></pre>
  
  <p>On clicking a button from the form, here is the callback that needs to grab the checked value of checkbox.</p>
  
  <pre><code>def btnStartCallBack():
      for chkBox in checkBoxList:
          print chkBox.variable().get()
          # also tried below
          # print chkBox.get()
          # print chkBox.var()
          # print chkBox.onvalue.get()
  </code></pre>
  
  <p>it returns:</p>
  
  <pre><code>AttributeError: Checkbutton instance has no attribute 'variable'
  </code></pre>
  
  <p>I just want to know whether it is possible or not to get the value of CheckButton when they are selected. And also at which attribute should I look for this?</p>