def open_file(filepath):
    """
    Open file with the default system app.
    Copied from https://stackoverflow.com/a/435669/1224456
    """
    if sys.platform.startswith('darwin'):
        subprocess.Popen(('open', filepath))
    elif os.name == 'nt':
        os.startfile(filepath)
    elif os.name == 'posix':
        subprocess.Popen(('xdg-open', filepath))
def open_file ( filepath ) : if sys . platform . startswith ( 'darwin' ) : subprocess . Popen ( ( 'open' , filepath ) ) elif os . name == 'nt' : os . startfile ( filepath ) elif os . name == 'posix' : subprocess . Popen ( ( 'xdg-open' , filepath ) )
Open file with the default system app.
    Copied from https://stackoverflow.com/a/435669/1224456