0

I have file dialog, where I click "open" it will open the filedialog. However, I need to restrict user to only select the files in current folder. How do I disable the top folder navigation menu option for the askopenfilename function? so they can't change the current folder

import tkinter as tk
from tkinter import filedialog as fd 

def callback():
    name= fd.askopenfile() 
    print(name)
    
errmsg = 'Error!'
tk.Button(text='Click to Open File', 
       command=callback).pack(fill=tk.X)
tk.mainloop()
Amy
  • 1

0 Answers0