Questions tagged [lupa]

Lupa is a rewrite of LunaticPython in Cython with additional features such as proper coroutine support. It integrates the runtimes of Lua or LuaJIT2 into CPython.

Lupa is a rewrite of LunaticPython in Cython with additional features such as proper coroutine support. It integrates the runtimes of Lua or LuaJIT2 into CPython.

Useful links

21 questions
5
votes
0 answers

Windows: fatal error C1083: Cannot open include file: 'lua.h': No such file or directory

I have tried to some requirements for a python project in windows, using pip install -r requirements.txt, however this keeps failing. After some investigation I have found that it fails because of lupa. Running "pip install lupa" shows the same…
5
votes
1 answer

Run Lua script from Python

Suppose I have a Lua script that contains 2 functions. I would like to call each of these functions with some arguments from a Python script. I have seen tutorials on how to embed Lua code in Python and vice versa using Lunatic Python, however, my…
user2253546
  • 575
  • 1
  • 8
  • 18
5
votes
1 answer

Can Lupa be used to run untrusted lua code in python?

Let's say I create LuaRuntime with register_eval=False and an attribute_filter that prevents access to anything except a few python functions. Is it safe to assume that lua code won't be able to do os.system("rm -rf *") or something like that?
ramirami
  • 501
  • 6
  • 15
2
votes
0 answers

Writting a wrapper for a customized lua-based scripting language

I have a program which is an extension of Lua, i.e. it includes a bunch of additional objects and functions. This program can now be used to execute lua scripts which make use of the additional features on top of standard lua. A generic example for…
user2224350
  • 2,262
  • 5
  • 28
  • 54
2
votes
1 answer

Saving Lua output to the Python string

I have a Lua expression, which can print some string. For example: print(1+2). Then, I call this expression in Python 3 using Lupa library: import lupa lua = lupa.LuaRuntime(unpack_returned_tuples=True) res = lua.eval('print(1+2)') Of course, res…
VeLKerr
  • 2,995
  • 3
  • 24
  • 47
2
votes
1 answer

Cannot execute lua code, read from file

I have some sample of lua code. For example: for i=1,4 do print(i) end and I need to execute it using Lupa library on Python 3.4. For doing this, I have write the following code: import lupa lua =…
VeLKerr
  • 2,995
  • 3
  • 24
  • 47
2
votes
1 answer

lunatic-python / lupa import issue on ubuntu

I tried installing Lua and the wrapper libraries for the same on my computer, but the execution fails in the following manner. After installing Lua-5.1, torch7, lua ( lunatic-python) , lupa, python-lua when i open the interpreter - >> import…
minocha
  • 1,043
  • 1
  • 12
  • 26
1
vote
0 answers

How do I bind Python function to Lua function in Lupa or Lunatic

How can I bind function created in python for use in Lua? In other words I want to make somewhat minimal Lua API in python.I can use both lupa or lunatic-python. # foo.py def foo(): # Do python stuff like access class defined before this…
Krzysiek127
  • 29
  • 1
  • 2
1
vote
0 answers

Can I import Lua files directly from within Python code?

I'm new to Python and using Pycharm. I have an application in Python and I wan't to be able to import Lua files and use them(the functions, variables and etc.) from within Python. Searching in google I found this website…
Tamar
  • 11
  • 1
1
vote
1 answer

Is there a way to run Lua scripts in Google App Engine (Python)?

I have a bunch of Lua scripts that I need to port to a Google App Engine application. Ideally I would like to be able to run those scripts within Python, either through and interpreter or with a wrapper/bridge like Lupa. Any ideas about how to…
Miki
  • 1,625
  • 21
  • 29
1
vote
0 answers

Failed to install lupa

I have tried to install Lupa with pip and it failed. When I ran python -m pip install -u lupa it returned Collecting lupa Using cached lupa-1.4.tar.gz Installing collected packages: lupa Running setup.py install for lupa ... error Complete…
houseofkraft
  • 191
  • 1
  • 2
  • 8
1
vote
0 answers

Transferring Python globals and locals to Lua

I'm trying to write Pyton 3 wrapper for eval() function for Lua source strings. For executing Lua expressions in Python I use eval() from Lupa library. But signature of eval() in Lupa is differ from Python built-in eval(): Lupa eval: eval(source:…
VeLKerr
  • 2,995
  • 3
  • 24
  • 47
1
vote
1 answer

Unable To Build Lupa

I'm trying to compile Lupa on Windows 7 64bit, and I've installed all of the dependencies (including LuaJIT2 and Lua 5.2). But when I try to install by running python setup.py install I get errors regarding dependancies, usually .m files. For…
1
vote
1 answer

lupa not working on mac OSX 10.9.5

Python 2.7.6 (v2.7.6:3a1db0d2747e, Nov 10 2013, 00:42:54) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from lupa import * >>> lua=LuaRuntime() dyld: lazy symbol…
user3709395
  • 11
  • 1
  • 3
1
vote
1 answer

Python Lupa Package Linking to liblua5.3.so?

I am attempting to add load the socket library in a Lupa runtime. I installed socket with Luarocks, so I needed to append the necessary paths. >>> import lupa >>> sys.setdlopenflags(orig_dlflags) >>> lua = lupa.LuaRuntime() >>>…
alexizydorczyk
  • 850
  • 1
  • 6
  • 25
1
2