I am currently trying to refresh the content in an entry field in python, below is my code:
from tkinter.filedialog import *
from tkinter import *
master = Tk()
menu = Menu(master)
master.config(menu=menu)
Label(master, text='Camera File:').grid(row=0, column=1)
def carddir_get():
temp_carddir = askdirectory(parent=master, title='Please select a directory')
print(temp_carddir)
cdg.delete(0,END)
cdg.insert(0,temp_carddir)
temp_carddir = StringVar()
temp_carddir.set("/path/to/card/")
temp_carddir.trace("w", temp_carddir)
cdg = Entry(master, textvariable=temp_carddir)
cdg.grid(row=0,column=2)
Button(master, text='Browse', command=carddir_get).grid(row=0, column=3)
mainloop()`
temp_carddir.trace("w", temp_carddir)My guess is that the second parameter should be a callback or something.