At the start of my code, I let the user choose a file and store its path in a text file. Here is the function for that:
def choose_folder(): root = tk.Tk()