title: Tkinter radiobutton returning only original set() value in class
body: <p>I am attempting to get this class working so that it writes the variables from each tab to a file. When I try this my RadioButton only returns the value '0', which is the one I originally set, not the (hopefully) updated value.<br>
  As well it runs on every feature, not just the one on the page at the time. Experiments with <code>open(file, w)</code> when I tried to clear the file seem to imply that clicking one update button calls the update function on one window, then separately again on the next. I think that I am having an issue with scope, but I am not sure, and am unable to find it, help would be appreciated.</p>
  
  <p>Here is the code as is stands</p>
  
  <pre><code>import tkinter as tk  
  from tkinter import ttk
  
  class orca_questions():
      def __init__(self):
          #this builds the window and notebool
          self.window = tk.Tk()
          self.window.title("Orca")
          self.tabs()
  
  
      def update(self, file = 'Orca_features', name = "", val = None):
  
          # this code should delete old instances
          #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          #        
          f = open(file, 'a')
          f.write(name + "_-_" + str(val)+'\n')
          f.close()    
  
  
  
      def radio_orca_tab(self, parent, options = [],
                         discription_text = '', feature_name = ""):
  
          feature_val = tk.StringVar()
          feature_val.set("0")
  
  
          #row and value for first button
          r = 1
  
          for o in options:
              #makes the radiobutton
              radiobutton1 = ttk.Radiobutton(parent, text=o,
                                         variable=feature_val, value=o)
              radiobutton1.grid(row=r, column=2, sticky=tk.W)
  
              #increases value and row, for differentiation
              r +=1
  
  
          ttk.Button(parent, text = "Update",
                     command = self.update(name = feature_name, val = feature_val.get())
                     ).grid(row=r-1 , column=4)
  
          ttk.Label(parent, text= discription_text).grid(row=3 , column=5)
  
  
  
  
      def tabs(self):
          #notebook_label = tk.Label(self.window, text="Notebook")
          #notebook_label.grid(row=3, column=2, sticky=tk.W, pady=3)
  
          tab = ttk.Notebook(self.window)
          tab.grid(row=1, column=1, sticky=tk.E + tk.W + tk.N + tk.S, padx=30,
                   pady=4)
  
  
          tab1 = tk.Frame(tab)
          tab.add(tab1, text="Gender", compound=tk.TOP)
  
          self.radio_orca_tab(parent = tab1, options = ['Male', 'Female'],
                         discription_text = 'Orca Whale gender can be dermined from fin shape. \nMale orcas have larger straighter fins, while females\nhave more dolphin like fins.', feature_name = "Gender")
  
          tab2 = tk.Frame(tab)        
          tab.add(tab2, text="Fin Condition", compound=tk.TOP)
          fin_desc = '''\tFins are considered missing the tip if less than the top 3rd 
          is broken off, if more the fin is considered broken'''
  
          self.radio_orca_tab(parent = tab2, options = ['Whole', 'Missing Tip', 'Broken', 'Floppy'],
                         discription_text = fin_desc, feature_name = "Fin Condition")
  
  
          tab3 = tk.Frame(tab)
          tab.add(tab3, text="Black Scars", compound=tk.TOP)
          scar_desc = '''\tIn the case that there are two different types of scars,
          description hierarchy goes: single lines&lt;parallel lines&lt;grid scars&lt;mixed scars.
          A whale with both mixed scars and parallel lines is described as one having mixed scars.
          Grid scars are where two or more parallel scars cross over other parallel scars perpendicularly'''
          self.radio_orca_tab(parent = tab3, options = ['No Black Scars', 'Isolated Scars', 'Parallel Line Scars', 'Grid Scars', 'Mixed Scars', 'Uncertain'],
                         discription_text = scar_desc, feature_name = "Black Scars")
  
  
          tab4 = tk.Frame(tab)
          tab.add(tab4, text="White Scars", compound=tk.TOP)
          self.radio_orca_tab(parent = tab4, options = ['No White Scars', 'Isolated Scars', 'Parallel Line Scars', 'Grid Scars', 'Mixed Scars', 'Uncertain'],
                         discription_text = scar_desc, feature_name = "White Scars")
  
  
          tab5 = tk.Frame(tab)
          tab.add(tab5, text="Saddle", compound=tk.TOP)
          saddle_desc = '''\tAn open saddle has has protusions inside the saddle, 
          where as the closed saddle is more like a circle superimposed on the
          orca'''
          self.radio_orca_tab(parent = tab5, options = ['Opened', 'Closed', 'Not Sure'],
                         discription_text = saddle_desc, feature_name = "Saddle")
  
  
  program = orca_questions()
  program.window.mainloop()
  </code></pre>
  
  <p>Any help is appreciated, thanks! (I am still new to classes and figuring out scope)</p>