the problem i am trying to solve is when the user starts the program , a file explorer opens. if the user exist the window i want to ask the user if they want to quit the program y or n.
from tkinter.filedialog import askdirectory
import pyinputplus as py
def get_location_path():
while True:
path = askdirectory(title='Select Folder') # shows dialog box and return the path to the folder the user picks
if path == '':
y = py.inputYesNo("would you like to quit the program? ")
if y == 'yes':
break
if y == 'no':
continue
else:
return path
y = get_location_path()
print(y)
when i run the program and i exist the window without picking a folder, it will ask me if i want to quit the program, if i type y it quits the program but if i type n it does nothing and i cant even exist the program by pressing CTRL + C
enter n:
would you like to quit the program? n
empyty space