selectFile

emlib.dialogs.selectFile(directory=None, filter='All (*.*)', title='Open file', backend=None)[source]

Create a dialog to open a file and returns the file selected

Parameters:
  • filter – a string of the form “<Mask> (<glob>)”. Multiple filters can be used, for example: "Image (*.png, *.jpg);; Video (*.mp4, *.mov)"

  • title – the title of the dialog

  • directory (Optional[str]) – the initial directory

  • backend (Optional[str]) – one of qt, tk, or None to select a default

Return type:

str

Returns:

the selected filename, or an empty string if the dialog is dismissed