QFileDialog.getOpenFileNames crashes the interpreter
I'm using PyQt5 and attempting to create a dialog that allows the user to select one or more files.
The following code functions but allows the user to select only a single file:
fname, _= QFileDialog.getOpenFileName(parent=self, directory=folder, caption='Select a file')
If I try to use `getOpenFileNames` instead of `getOpenFileName`, the interpreter crashes. Please advise.
Re: QFileDialog.getOpenFileNames crashes the interpreter
Quote:
Originally Posted by
pfeldman
If I try to use `getOpenFileNames` instead of `getOpenFileName`, the interpreter crashes. Please advise.
How does it crash, because it certainly does not here.
Re: QFileDialog.getOpenFileNames crashes the interpreter
Quote:
fname, _= QFileDialog.getOpenFileName(parent=self, directory=folder, caption='Select a file')
Why the ",_" ? getOpenFileName() (or getOpenFileNames()) only returns a single value, either a QString or a QStringList.