8.5.6.4. pymodaq_gui.utils.file_io module
- pymodaq_gui.utils.file_io.select_file(start_path='C:\\Data', save=True, ext=None, filter=None, force_save_extension=False) Path[source]
Opens a selection file popup for loading or saving a file
- Parameters:
start_path (str or Path) – The strating point in the file/folder system to open the popup from
save (bool) – if True, ask you to enter a filename (with or without extension)
ext (str) – the extension string, e.g. xml, h5, png …
filter (string) – list of possible extensions, if you need several you can separate them by ;; for example: “Images (.png *.xpm *.jpg);;Text files (.txt);;XML files (*.xml)”
force_save_extension (bool) – if True force the extension of the saved file to be set to ext
- Returns:
Path
- Return type:
the Path object of the file to save or load
- pymodaq_gui.utils.file_io.select_file_filter(start_path='C:\\Data', save=True, ext=None, filter=None, force_save_extension=False)[source]
Opens a selection file popup for loading or saving a file
- Parameters:
start_path (str or Path) – The strating point in the file/folder system to open the popup from
save (bool) – if True, ask you to enter a filename (with or without extension)
ext (str) – the extension string, e.g. xml, h5, png …
filter (list of string) – list of possible extensions, mostly valid for loading
force_save_extension (bool) – if True force the extension of the saved file to be set to ext
- Returns:
Path (the Path object of the file to save or load)
str (the selected filter)