Hi, I'm looking into using Lua in a web project. I can't seem to find any way of directly parsing in pure python and running Lua code in Python.
Does anyone know how to do this?
Joe
Hi, I'm looking into using Lua in a web project. I can't seem to find any way of directly parsing in pure python and running Lua code in Python.
Does anyone know how to do this?
Joe
See this question: What web server to use for Lua web development.
There's no need to parse Lua in Python.
If you want Python use Python. Same with Lua.
Why mix both languages?
There's this project (pylux) which embeds Lua in Python. It seems rather inactive though, but it may be a good project to have a look at.
From your comments, it appears you a interested in a secure way of executing untrusted code.
Redifining python builtins, as you suggested in a comment, is a horrible way to secure code.
What you want is sandboxing, there are solutions for python, but I wouldn't recommend them. You would be much better of using Jython or IronPython, because the JVM and .NET clr, were designed with sandboxing in mind.
I personally believe that in most cases, if you need to execute untrusted code, then you are putting too much or not enough trust in your users.