title: Tkinter: change class variable when pressing a button
body: <p>I am writing a function that get called when I click a button, but before calling this function, I would like to change a class variable.</p>
  
  <p>How do you do that in a button ? As now I did declare the button as following:</p>
  
  <pre><code>calculatebutton = Button(self, text="run function", command=self.calculate_total(self.totals))
  calculatebutton.place(x=150, y=600)
  </code></pre>
  
  <p>This run my function, but I want to change also a class variable, and I want to change it before I run the function.</p>