-
-
Save den-run-ai/080c1587829558334544992b566edbe3 to your computer and use it in GitHub Desktop.
Open file dialog for default ipython notebook in Anaconda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def openfile_dialog(): | |
from PyQt5 import QtGui | |
from PyQt5 import QtGui, QtWidgets | |
app = QtWidgets.QApplication([dir]) | |
fname = QtWidgets.QFileDialog.getOpenFileName(None, "Select a file...", '.', filter="All files (*)") | |
return str(fname) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
fname,_filter = QtWidgets.QFileDialog.getOpenFileName(None, "Select a file...", '.', filter="All files (*)")
This is required to return only the file name.
https://stackoverflow.com/a/43509281