gui.editor.open_folder(path, launch=subprocess.Popen, platform=None)
Show a directory in the file manager (Finder on macOS) and return at once.
Parameters
| path |
Path | str |
The directory. |
required |
| launch |
Callable[…, object] |
Starts the argument list; replaceable for tests. |
subprocess.Popen |
| platform |
str | None |
The platform name. Defaults to sys.platform. |
None |
Returns
|
list[str] |
list[str]: The argument list that was started. |
Raises
|
OSError |
If the program cannot be started. |
Examples
from spotregen.gui.editor import open_folder
started = []
open_folder("/work/demo/regen/runs", started.append, "darwin")
print(started)
[['open', '/work/demo/regen/runs']]