| 2071 | |
| 2072 | # ---------------- auto open ---------------- |
| 2073 | def open_in_browser(url: str) -> None: |
| 2074 | try: |
| 2075 | if which("termux-open-url"): |
| 2076 | subprocess.Popen(["termux-open-url", url], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
| 2077 | return |
| 2078 | if which("xdg-open"): |
| 2079 | subprocess.Popen(["xdg-open", url], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
| 2080 | return |
| 2081 | except Exception: |
| 2082 | pass |
| 2083 | print(f"Open this in your browser: {url}") |
| 2084 | |
| 2085 | |
| 2086 | def delayed_open(url: str, delay: float = 0.8) -> None: |