I am trying to get the User to select a destination directory for some files the code will create later; the chosen directory will be stored by the code until needed. I can code for a file name (code below), but I don't know how to code for just the directory. Is there something like '.getOpenDirectoryName()', or do I need a different approach?
default_file_path, _ = QtWidgets.QFileDialog.getOpenFileName(
None, "Select Defaults File", "", "Default Files (*.txt)")
if default_file_path == '':
msgBox = QtWidgets.QMessageBox()
msgBox.setText("No file selected")
msgBox.setStandardButtons(QtWidgets.QMessageBox.Ok)
msgBox.setIcon(QtWidgets.QMessageBox.Warning)
msgBox.exec_()