initial commit
https://claude.ai/chat/39b41476-837c-4d19-b91f-6b6cd6ce9629
This commit is contained in:
29
python/rhai/__init__.py
Normal file
29
python/rhai/__init__.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
Rhai Python Bindings
|
||||
|
||||
Python bindings for the Rhai scripting language.
|
||||
"""
|
||||
|
||||
from .rhai_python import RhaiEngine, __version__
|
||||
|
||||
__all__ = ["RhaiEngine", "__version__"]
|
||||
|
||||
|
||||
# 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)
|
||||
Reference in New Issue
Block a user