diff options
| -rw-r--r-- | tests/json.lua | 0 | ||||
| -rw-r--r-- | tests/lua_in_python.py | 22 |
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/json.lua b/tests/json.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/tests/json.lua diff --git a/tests/lua_in_python.py b/tests/lua_in_python.py index eec2042..7692e2f 100644 --- a/tests/lua_in_python.py +++ b/tests/lua_in_python.py @@ -16,20 +16,22 @@ print( from lupa import LuaRuntime lua = LuaRuntime(unpack_returned_tuples=True) -import asyncio +import os -async def get_Dice_Dir(): - import os - await asyncio.sleep(1) +def get_Dice_Dir(): return os.path.dirname(os.path.abspath(__file__)) lua.globals().getDiceDir = get_Dice_Dir - -print( - lua.eval( +lua.globals().package.path = lua.globals().package.path + ';' + os.path.join(get_Dice_Dir(), '?.lua') +try: + lua.execute( """\ - getDiceDir() - """ + print(getDiceDir()) + print(package.path) + js = require('json') + print(js) + """ ) -) +except Exception as e: + print(f'{e!r}')
\ No newline at end of file |
