selector = wx.DirSelector("Choose a folder") if selector.strip(): # Do something with the folder name print selector