Skip to content

Instantly share code, notes, and snippets.

@mstankie
Forked from tritemio/open file dialog
Last active June 2, 2017 11:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mstankie/00acb753bff90692dbe50e246392dcd8 to your computer and use it in GitHub Desktop.
Save mstankie/00acb753bff90692dbe50e246392dcd8 to your computer and use it in GitHub Desktop.
Open file dialog for default ipython notebook in Anaconda
def selectFile(startDir = '.', filter = "All files (*)", title = "Select a file..."):
from PyQt4 import QtGui
app = QtGui.QApplication([dir])
fname = QtGui.QFileDialog.getOpenFileName(None, title, startDir, filter=filter)
return str(fname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment