Utility functions#
- edifice.utilities.alert(message, choices=None)[source]#
Displays a message in an alert box.
If choices is specified, the alert box contain a list of buttons showing each of the choices, and this function will return the user’s choice.
- Parameters:
message (
str
) – message to displaychoices (
Optional
[Sequence
[str
]]) – optional list of choice texts, which will be displayed as buttons.
- Return type:
Optional
[int
]- Returns:
Index of chosen option.
- edifice.utilities.file_dialog(caption='', directory='', file_filter=None)[source]#
Displays a file choice dialog.
- Parameters:
caption (
str
) – the file dialog’s captiondirectory (
str
) – starting directory for the file dialogfile_filter (
Optional
[Sequence
[str
]]) –Sequence of allowed file extensions. For example:
"*.cpp *.cc *.C *.c++" "C++ files (*.cpp *.cc *.C *.c++)"
are both valid ways of specifying a file filter.
- Return type:
Optional
[str
]- Returns:
Path of chosen file