title: Python Redefine the variable given as a parameter to the function
body: <p>Hello I am trying to make theme window with tkinter. There is 5 variable for different widgets's color. I will use color dialog for choosing colors but I don't want to define 5 functions. So I think I can make 1 function with 1 parameter of which variable to change color of it. My code is below;</p>
  <p>My variables:</p>
  <pre><code>generalBgColor = '#454b4d'
  generalFgColor = '#f2fdff'
  generalBtnColor = '#0a5e7a'
  mainLabelColor = '#ffffff'
  highlightedLetterColor = '#ff0000'
  </code></pre>
  <p>Buttons that call <code>pickColor</code> function:</p>
  <pre><code>bgButton = tk.Button(themeWindow, text=' ', relief='ridge',
                           bg=generalBgColor, width=6, command=lambda: pickColor(generalBgColor))
  
  fgButton = tk.Button(themeWindow, text=' ', relief='ridge',
                           bg=generalFgColor, width=6, command=lambda: pickColor(generalFgColor))
  
  btnButton = tk.Button(themeWindow, text=' ', relief='ridge',
                            bg=generalBtnColor, width=6, command=lambda: pickColor(generalBtnColor))
  
  mainlButton = tk.Button(themeWindow, text=' ', relief='ridge',
                              bg=mainLabelColor, width=6, command=lambda: pickColor(mainLabelColor))
  
  letterButton = tk.Button(themeWindow, text=' ', relief='ridge',
                               bg=highlightedLetterColor, width=6,
                               command=lambda:pickColor(highlightedLetterColor))
  
  </code></pre>
  <p>And this is the my function:</p>
  <pre><code>def pickColor(variable):
          global generalBgColor, generalFgColor, generalBtnColor, mainLabelColor, highlightedLetterColor
          tempColor = askcolor(color=variable, title='Choose A Color')
          variable = tempColor[1]
  </code></pre>
  <p>There is no error but variable doesn't change.
  I know this won't work this is the reason why I ask here for help.</p>