Tkinter dialog to open file or directory
I have solved it in a different way. The only downside is that I can't select multiple files or folders, but other than that it does exactly what I wanted it to do.
Here is the code I used:
mydocs_pidl = shell.SHGetFolderLocation(0, shellcon.CSIDL_DRIVES, 0, 0) pidl, display_name, image_list = shell.SHBrowseForFolder( win32gui.GetDesktopWindow(), mydocs_pidl, "Select a file or folder", shellcon.BIF_BROWSEINCLUDEFILES, None, None )if (pidl, display_name, image_list) == (None, None, None): print("No file or directory selected!")else: path = str(shell.SHGetPathFromIDList(pidl)) print(path)