bootstack.ask_open_file#
- bootstack.ask_open_file(*, title='', initial_dir='', file_types=None, parent=None)#
Show a native open dialog for a single file and return its path.
- Parameters:
title (str) – Dialog window title.
initial_dir (str) – Directory to open in. Defaults to the last used location.
file_types (list[tuple[str, str]] | None) – Selectable file types as
(label, pattern)pairs, for example[('Images', '*.png *.jpg'), ('All files', '*.*')].parent (Any) – Parent widget. Defaults to the active root window.
- Returns:
The chosen file path, or
Noneif canceled.- Return type:
str | None