Page MenuHomePhabricator

test_python-lua.py

Authored By
bzimport
Nov 22 2014, 2:31 AM
Size
704 B
Referenced Files
None
Subscribers
None

test_python-lua.py

# install f15 packages: 'lua', 'lunatic-python'
#
# or download from and build yourself
# http://labix.org/lunatic-python
# run 'python setup.py build'
#
# http://labix.org/lunatic-python#head-1287b0fad0175e2b4da800c4ebe0e10ab47d1e22
# http://de.wikipedia.org/wiki/Lua#Beispielcode
lua_code = """
function factorial(n)
if n == 0 then
return 1
else
return n * factorial(n - 1)
end
end
function test(DATA)
DATA[0] = "Hallo Welt!"
end
print(DATA)
print(DATA[0])
test(DATA)
"""
import lua
print "--- --- --- lua --- --- ---"
lua.globals().DATA = ["Hallo LUA!"] # issues with long unicode items
lua.execute( lua_code )
print "--- --- --- python --- ---"
print lua.globals().DATA

File Metadata

Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11912
Default Alt Text
test_python-lua.py (704 B)

Event Timeline