As I type into Entry "e1", Label "l1" updates to display the entry. I plan to use this later to preview multiple entries in a single line.
My question: How can I get the Label "l1" to display with single quotes around it as I type into Entry "e1". The quotes should only appear when there is text in Entry "e1". They should also be removed if the content in Entry is deleted.
I'm quite new to this so simple answers please.
from tkinter import *
root = Tk()
def printEntry():
complete = var1.get() + var2.get()
print (complete)
var1 = StringVar()
var2 = StringVar()
e1 = Entry(root, width = 15, textvariable = var1)
e1.pack()
l1 = Label(root, textvariable = var1)
l1.pack()
e2 = Entry(root, width = 15, textvariable = var2)
e2.pack()
l2 = Label(root, textvariable = var2)
l2.pack()
b = Button(root, text = "CONFIRM", command = printEntry)
b.pack()
mainloop()