Files
slint/api/python/slint/__init__.py
Simon Hausmann d1529af3cc python: hide native module behind python front-end API
Encapsulate the rust code behind a public API (in __init__.py for now)
2023-12-21 12:57:35 +01:00

11 lines
350 B
Python

# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
from . import slint as native
def load_file(path):
compiler = native.ComponentCompiler()
compdef = compiler.build_from_path(path)
instance = compdef.create()
return instance