gui.editor.open_folder

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

Name Type Description Default
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

Name Type Description
list[str] list[str]: The argument list that was started.

Raises

Name Type Description
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']]