def fileOpenDlg(tryFilePath='', tryFileName='', prompt=_translate('Select file to open'), allowed=None):
 global qtapp
 qtapp = ensureQtApp()
 if (allowed is None):
  allowed = 'All files (*.*);;PsychoPy Data (*.psydat);;txt (*.txt *.dlm *.csv);;pickled files (*.pickle *.pkl);;shelved files (*.shelf)'
 fdir = os.path.join(tryFilePath, tryFileName)
 filesToOpen = QtWidgets.QFileDialog.getOpenFileNames(parent=None, caption=prompt, directory=fdir, filter=allowed)
 if (type(filesToOpen) == tuple):
  filesToOpen = filesToOpen[0]
 filesToOpen = [unicode(fpath) for fpath in filesToOpen if os.path.exists(fpath)]
 if (len(filesToOpen) == 0):
  return None
 return filesToOpen

def fileOpenDlg ( tryFilePath = '' , tryFileName = '' , prompt = _translate ( 'Select file to open' ) , allowed = None ) : global qtapp qtapp = ensureQtApp ( ) if ( allowed is None ) : allowed = 'All files (*.*);;PsychoPy Data (*.psydat);;txt (*.txt *.dlm *.csv);;pickled files (*.pickle *.pkl);;shelved files (*.shelf)' fdir = os . path . join ( tryFilePath , tryFileName ) filesToOpen = QtWidgets . QFileDialog . getOpenFileNames ( parent = None , caption = prompt , directory = fdir , filter = allowed ) if ( type ( filesToOpen ) == tuple ) : filesToOpen = filesToOpen [ 0 ] filesToOpen = [ unicode ( fpath ) for fpath in filesToOpen if os . path . exists ( fpath ) ] if ( len ( filesToOpen ) == 0 ) : return None return filesToOpen
a simple dialogue allowing read access to the file system .