So I'm able to run this perfectly fine through IDLE, but when I try to run it through the shell by double clicking, I get the following when I click the "Select Directory" button:
"NameError: name 'filedialog' is not defined"
I'm just getting the hang of tkinter, if you see anything else that would be coded a better way I'm open to criticism.
from tkinter import *
import os, subprocess, shutil
window = Tk()
currentdir = StringVar()
def getdir():
global currentdir
currentdir.set(filedialog.askdirectory(initialdir = os.getcwd()))
def run():
window.destroy()
seldirbtn = Button(window, text = "Select Directory", command = getdir)
seldirbtn.grid(row =0, column =0)
seldirlbl = Label(window, textvariable = currentdir)
seldirlbl.grid(row =0, column =2)
runbtn = Button(window, text = "RUN", command = run)
runbtn.grid(row = 1, column =1)
window.mainloop()