Skip to content Skip to sidebar Skip to footer

How To Save Askdirectory Result In A Variable I Can Use Using Tkinter With Oop?

I have ran into some trouble. I'm quite new to OOP and working with tkinter and GUI's in general. I have managed to find some code on the Internet and meshed it all together to cre

Solution 1:

I had an idea:

example, if you have f inside a function, you can make it global to have access as variable

def print_path():  
    # select working directory
    global f #make f global to access the path
    f = filedialog.askdirectory(parent=root, initialdir="/", title='Select Dir') 

Post a Comment for "How To Save Askdirectory Result In A Variable I Can Use Using Tkinter With Oop?"