Coverage for examples/gcd.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-02-20 16:25 +0000

1# Example of instantiating a wasm module and calling an export on it 

2 

3from wasmtime import Store, Module, Instance 

4 

5store = Store() 

6module = Module.from_file(store.engine, './examples/gcd.wat') 

7instance = Instance(store, module, []) 

8gcd = instance.exports(store)["gcd"] 

9 

10print("gcd(6, 27) = %d" % gcd(store, 6, 27))