MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / main

Function main

examples/01_basic/python/main.py:8–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def main() -> None:
9 lake_dir = Path(__file__).resolve().parent.parent / "lean"
10 lib = LeanLibrary.from_lake(lake_dir, "Basic", build=True)
11
12 print("py_increment(7) =", lib.increment(7))
13 print('py_greet("world") =', lib.greet("world"))
14 print("py_sum_array([1..10]) =", lib.sumArray(list(range(1, 11))))
15 print("py_origin(()) =", lib.origin(None))
16 print("py_norm_sq((3, 4)) =", lib.normSq(lib.Point(3, 4)))
17 print("py_perimeter(circle 5) =", lib.perimeter(lib.Shape.circle(5)))
18 print("py_perimeter(square 4) =", lib.perimeter(lib.Shape.square(4)))
19 print("py_perimeter(rect 2 3) =", lib.perimeter(lib.Shape.rect(2, 3)))
20
21
22if __name__ == "__main__":

Callers 1

main.pyFile · 0.70

Calls 1

from_lakeMethod · 0.80

Tested by

no test coverage detected