Files
CCMA/src/ccma/ui/file_open.py
T

17 lines
409 B
Python

from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
def open_path(path: Path) -> None:
selected = path.resolve()
if sys.platform == "win32":
os.startfile(selected) # type: ignore[attr-defined]
elif sys.platform == "darwin":
subprocess.Popen(["open", str(selected)])
else:
subprocess.Popen(["xdg-open", str(selected)])