lua与python结合,如何将Lua嵌入Python?

您所在的位置:网站首页 lua与python结合 lua与python结合,如何将Lua嵌入Python?

lua与python结合,如何将Lua嵌入Python?

2024-03-15 17:41| 来源: 网络整理| 查看: 265

This sounds like a weird question, so I'll explain circumstances surrounding first.

Basically, I have a 3D game development kit, written in Python, that works excellently by itself. However, most of my users will be used to using Lua as a scripting language, so I started to look at Lua-Python bindings.

I settled with Stefan Behnel's amazing Lupa library. However, it basically requires end-users to know how to compile applications, which is unacceptable for my GDK. Also, I normally can only access a Linux system, and since my game development kit runs on Windows and Mac OSX, the Windows binaries always lag behind, and my OSX users must compile my GDK themselves.

Does anyone know another alternative? Thank you!

P.S: I've already tried Lunatic Python, and Lux is too outdated.

解决方案

you should look into lunatic-python it is a 2 way bridge between python and lua.

an example off the site shows how natural and easy it is:

>>> import lua

>>> lg = lua.globals()

>>> lg.string

>>> lg.string.lower

>>> lg.string.lower("Hello world!")

'hello world!'



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3