Files
rhai-python/python/rhai/__init__.py

30 lines
536 B
Python
Raw Permalink Normal View History

"""
Rhai Python Bindings
Python bindings for the Rhai scripting language.
"""
2025-08-12 22:28:01 +02:00
from .rhai_python import RhaiEngine
2025-08-12 22:28:01 +02:00
__all__ = ["RhaiEngine", "eval"]
# Convenience function for quick evaluation
def eval(script: str):
"""
Evaluate a Rhai script and return the result.
Args:
script: The Rhai script to evaluate
Returns:
The result of the script evaluation
Example:
>>> import rhai
>>> rhai.eval("40 + 2")
42
"""
engine = RhaiEngine()
return engine.eval(script)