0

I'm trying to get the second filedialog call in my script to open to my local C drive, but it will only open the first call's initialdir, which is a UNC path. (Both are stored in different variables).

1: Is the following syntax correct, and is there anything I need to do to force the code to use the second call's initialdir?

filedialog.askdirectory(initialdir=r"C:\\Users\\User1\\Desktop",title='Please select a directory')

2: Also, can you have a variable in the initialdir, like this?

filedialog.askdirectory(initialdir=r"C:\\Users\\User1\\"+variable+"\UserFolder1",title='Please select a directory')
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
JM1
  • 1,595
  • 5
  • 19
  • 41
  • Does this help? https://stackoverflow.com/questions/63221952/python-tkinter-tkinter-askdirectory-returns-the-initial-default-directory-whe – toyota Supra May 05 '23 at 11:44
  • Thanks for the link! I'm not sure if it helps. I was not able to get it to work. I'm not sure what the root window is or if I have to use it to get my second dialog to work. – JM1 May 05 '23 at 12:21

0 Answers0