PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os
def install(package):
__import__('os').system("pip install -qq --target='/usercode' " + package)
__import__('os').system("pip -qqq install --upgrade pip")
install("lupa")
import lupa
from lupa import LuaRuntime
lua = LuaRuntime(unpack_returned_tuples=True)
lua_code = """
-- Base Class (Parent Class)
local Animal = {}
Animal.__index = Animal
-- Constructor for the Animal class.
function Animal:new(name)
local self = setmetatable({}, Animal) -- Create a new table with Animal as its metatable.
self.name = name
return self
end
-- Method for Animal to make a generic sound.
function Animal:makeSound()
print("There are other animals and animal sounds in the area.")
end
Enter to Rename, Shift+Enter to Preview
OUTPUT
Laufen