mirror of
https://git.hiabuto.net/C3MA/CCMA.git
synced 2026-09-06 03:20:49 +02:00
17 lines
409 B
Python
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)])
|