1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: improve the examples/call_v_from_python with Python showing the result of the calculation done on the V side

This commit is contained in:
Delyan Angelov
2022-10-16 22:48:00 +03:00
parent 409a4f33a1
commit 7302d8c4a8
2 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ so_file="./test.so"
if os.name=="nt":
so_file="./test.dll"
lib = CDLL(so_file)
print("lib.square(10) result is", lib.square(10))
assert lib.square(10) == 100, "Cannot validate V square()."
lib.sqrt_of_sum_of_squares.restype = c_double