code: def select_directory_dialog(windowTitle, defaultPath=os.getcwd(), style=None):
      
      app = wx.App(None)
  
      if style == None:
          style = wx.DD_DIR_MUST_EXIST
  
      dialog = wx.DirDialog(None, windowTitle, defaultPath=defaultPath, style=style)
  
      if dialog.ShowModal() == wx.ID_OK:
          path = dialog.GetPath()
      else:
          path = None
      dialog.Destroy()
      return path
docs: Opens a directory selection dialog
          Style - specifies style of dialog (read wx documentation for information)