import os
import webbrowser

class JarvisFileOpener:
    def __init__(self):
        self._file = ""

    @property
    def open(self):
        return self._file

    @open.setter
    def open(self, path_or_url):
        self._file = path_or_url
        if path_or_url.lower().startswith(("http://", "https://")):
            try:
                webbrowser.open(path_or_url)
            except:
                pass
        elif os.path.exists(path_or_url):
            try:
                os.startfile(path_or_url)
            except:
                pass

jarvisfileopen = JarvisFileOpener()
