I'm using a askdialog box from tkinter with a form. My problem is when I use "print" or "return" to get the selected directory it prints it to the terminal (if open) and I would like it to print to an Entry textbox. For example:
from Tkinter import * from tkFileDialog import askdirectory root = Tk() e1 = Entry(root) def browser(): dir1 = askdirectory(title="Select A Folder", mustexist=1) if len(dir1) > 0: print dir1 ###<----------I would like this "dir1" to print into the "e1" Entry above Button(root, text='Browse', command=browser) root.mainloop()
I feel like this should be pretty easy but can't seem a way to figure it out. I'm new to Python and taking the learn-as-I-go approach. Any help would be much appreciated.