v/examples/call_v_from_python
2025-03-13 19:51:51 +02:00
..
README.md
test.py examples: show how to create and pass a V string to a V function, and then get back a V string in Python 2024-06-03 19:26:30 +03:00
test.v tools: cleanup entries from the hardcoded skip_files list in common.v (used by v test, v test-self etc); use the new // vtest build: syntax to mark the tests instead (#23918) 2025-03-13 19:51:51 +02:00

A simple example to show how to call a function written in v from python

Step 1: Compile the v code to a shared library using v -d no_backtrace -shared test.v

Step 2: Run the python file using python3 test.py

Note: you do not need -d no_backtrace if you use gcc or clang .