title: Trace on Tkinter StringVar to change label
body: <p>I have an issue with the following code snippet in Python (version 3.9) that should change a label's text based on an entry widget:</p>
  <pre><code>import tkinter as tk
  
  def change_labels():
      print(currency.get())  # for debugging tracing
      print('1')             # for debugging tracing
      lbl_electricity['text'] = &quot;Electricity Price (&quot; + currency.get() + &quot;/kWh)&quot;
  
  
  gui_present = tk.Tk()
  
  currency = tk.StringVar()
  currency.set('USD')  # sets initial value of currency
  
  lbl_electricity = tk.Label(gui_present, text=&quot;Electricity Price (&quot; + currency.get() + &quot;/kWh)&quot;)
  lbl_electricity.place(relx=0.05, rely=0.03, height=25, width=175)
  # displays &quot;Electricity Price (USD/kWh)&quot; initially as required
  
  input_currency = tk.Entry(gui_present, textvariable=currency)
  input_currency.insert(0, currency.get())  # sets the entry widget to display the initial value &quot;USD&quot;
  input_currency.place(relx=0.5, rely=0.03, width=40, height=20)
  
  currency.trace(&quot;w&quot;, change_labels)
  
  gui_present.mainloop()
  </code></pre>
  <p>The idea of the program is obviously that if I type EUR into the entry widget, the text of the label changes to</p>
  <pre><code>&quot;Electricity Price (EUR/kWh)&quot;
  </code></pre>
  <p>However, the function <code>change_labels()</code> is never executed if I type something into the entry widget (neither '1' nor the current value of currency is printed in the console). If I, just for testing purposes, remove the trace and the <code>text</code> property of the label, and put <code>currency</code> as textvariable for both widgets, the update works. But not via the update function I'd like to combine the value of <code>currency</code> with additional text.</p>
  <p>Thanks a lot in advance for any help!</p>