title: How to save output of a function in a variable without overwriting when it gets called multiple times? Tktiner Python
body: <p>With the following Code I manly want to get selections from listboxes.
  When a Button is pressed the function will be called. If I do a debug print from selection_listboxes. When  push the button, I get different debug prints with different value lists,  of the things I chose. But when I try to get the variable selection_listboxes in a other part of the programm it's always the same values in the list. <strong>How can I save the selections of the listboxes in variables, when the function gets called multiple times, with out overwriting it all the time?</strong></p>
  <pre><code>
   def get_selection_l(self, window, button_lib, list_elements, listbox):
          **self.selection_listboxes** = [list_elements[int(item)] for item in listbox.curselection()]
          if self.is_unmarked == TRUE and self.selection_listboxes:
              try:
                  self.confirm_Button_comp.config(state='disabled')
              except TclError:
                  pass
          if not self.selection_listboxes:
              self.selection_listboxes = &quot;&quot;
          button_lib.config(state='normal')
          print(self.selection_listboxes)
          window.destroy()
  
  </code></pre>