Closed knassar702 closed 2 years ago
You gotta use the exportpy:
# mymodule.nim - file name should match the module name you're going to import from python
import nimpy
proc greet(name: string): string {.exportpy.} =
return "Hello, " & name & "!"
Lookup the docs for Nimpy as Nimporter just makes Nimpy modules easier to import. Also, main functions are not supported I don't think since the Nim code is supposed to be imported, not run directly.
thanks for your answer , its work :D
hello , im trying to run simple nim code inside python script with nimporter but i always got an error about importing error from GCC
☰ Error
``` $ python test.py gcc: fatal error: no input files compilation terminated. Traceback (most recent call last): File "/home/knassar702/.local/lib/python3.9/site-packages/nimporter.py", line 863, in __validate_spec util.module_from_spec(spec) File "Env