i wrote some code to make GUI program
import os
from tkinter import *
from tkinter import filedialog
dirName = os.getcwd()
def getDirName():
global dirName
dirName = filedialog.askdirectory()
if dirName != ####:
lbl_1_2.configure(text=dirName)
else:
pass
# lbl_1_2 = Label(app, text=dirName)
# btn_1 = Button(app, text="change", width=15, command=getDirName)
If I close file explorer without select directory (press esc or click [x])
then a value will return to dirName.
what is it? null? 0? trash? how can I get that value and insert to #### ?
thank you for reading
filedialog
?getDirName
to reduce our guessworknull
in python ;) Did you try justif dirName:
?