(path: str)
| 18 | |
| 19 | |
| 20 | def open_file(path: str) -> None: |
| 21 | if sys.platform.startswith("darwin"): |
| 22 | subprocess.run(["open", path], check=False) # macOS |
| 23 | elif os.name == "nt": # Windows |
| 24 | os.startfile(path) # type: ignore |
| 25 | elif os.name == "posix": |
| 26 | subprocess.run(["xdg-open", path], check=False) # Linux/Unix |
| 27 | else: |
| 28 | print(f"Don't know how to open files on this platform: {sys.platform}") |
| 29 | |
| 30 | |
| 31 | async def main(): |