Hi, I’ve been working on a program for few days, and in it I want to allow my user to select multiple directories. I was using wxpython to make my program, and found out wx.DirDialog’s GetPaths() method could possibly make this work.
But instead what I kept getting was ‘None’, and I am not either quite sure what an ‘array path’ is, nor what to fill in at the parameter of this method. What I want instead is a list of paths selected by the user.
This is the link to the specific method description, in the Class API page: wx.DirDialog — wxPython Phoenix 4.1.1 documentation
I am using Windows 10, Python 3.9.1, and wxPython 4.1.1.
Below is my code;
def getDirectories(self, event):
global multipleDir
global multipleExport
dirs = []
dlg = wx.DirDialog(None, "Choose input directory", "", wx.DD_MULTIPLE | wx.DD_DIR_MUST_EXIST)
if dlg.ShowModal() != wx.ID_OK:
print("You Cancelled The Dialog!")
dlg.Destroy()
return
paths = dlg.GetPaths(dirs)
print(paths)
dlg.Destroy()
Thanks in advance.