Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12460
test_python-lua.py
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 22 2014, 2:31 AM
2014-11-22 02:31:22 (UTC+0)
Size
704 B
Referenced Files
None
Subscribers
None
test_python-lua.py
View Options
# 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
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
11912
Default Alt Text
test_python-lua.py (704 B)
Attached To
Mode
T57673: Migrate "DrTrigon's tools" (pywikibot/bots/drtrigonbot) bugs from JIRA (TS) to Bugzilla (set up product etc)
Attached
Detach File
Event Timeline
Log In to Comment