I would like to display the value of several StringVar()
with some formatting on Labels.
import tkinter as tk
keys = range(2) # 2 for simplicity
r
You can send the key and the input to the function. This is a truncated version and a little different than your code but does what I think you want.
import tkinter as tk
from functools import partial
def callback(key, var, *args):
print "callback var =", key, var.get()
##myStrVars[key].set(var[-1])
root = tk.Tk()
for key in range(5):
var = tk.StringVar()
var.trace('w', partial(callback, key, var))
tk.Entry(root, textvariable=var).pack()
root.mainloop()