code: def getexistingdirectory(parent=None, caption='', basedir='',
                           options=QFileDialog.ShowDirsOnly):
      
      # Calling QFileDialog static method
      if sys.platform == "win32":
          # On Windows platforms: redirect standard outputs
          _temp1, _temp2 = sys.stdout, sys.stderr
          sys.stdout, sys.stderr = None, None
      try:
          result = QFileDialog.getExistingDirectory(parent, caption, basedir,
                                                    options)
      finally:
          if sys.platform == "win32":
              # On Windows platforms: restore standard outputs
              sys.stdout, sys.stderr = _temp1, _temp2
      if not is_text_string(result):
          # PyQt API #1
          result = to_text_string(result)
      return result
docs: Wrapper around QtGui.QFileDialog.getExistingDirectory static method
      Compatible with PyQt >=v4.4 (API #1 and #2) and PySide >=v1.0