Filechooser : Interactively select file or directory using a widget

Module to interactively select a file or directory. Uses the GtkFileChooser widget.

tesfdmtools.utils.widgets.filechooser.getfile(fpatt='*', pattern=None, parent=None, newfile=False, path=None, multiple=False)[source]

Interactively select a file.

Kwargs:
  • fpatt = File pattern to seach for (e.g. *.typ,*.*,*aa*.txt)

  • pattern = File pattern to seach for (e.g. *.typ,*.*,*aa*.txt) (identical to fpatt )

  • path = Path where to search for files

  • parent = Parent window, if it exists

  • newfile = Allow specification of a new file when True

  • multiple = Allow multiple files to be selected when True

Returns:
  • selected file

tesfdmtools.utils.widgets.filechooser.getdir(path=None, parent=None)[source]

Interactively select a directory

Kwargs:
  • path = Path where to search for directories

  • parent = Parent window, if it exists

Returns:
  • selected directory