Closed UnixJunkie closed 2 years ago
If I have a python "module". I.e. I wrote a couple of functions into a Python file. Let's say toto.py. What is the proper way to make pyml aware of this Python module? My plan is for my ocaml program to just call functions from this module, which would have done all the imports it needs and such. Do I have to install this toto.py file? How (using pip?) and where should it be installed? Sorry if this is a dumb question.
Or, is there a way to say: "please pyml, interprete the toto.py file because then I am going to call functions from it" ?
In pyml_tests.ml there are probably some example bits that I need.
Sorry for the delay. I think that let toto = Py.Import.import_module "toto"
should do the trick.
Thanks a lot Thierry! You're the best.
I wonder if I can combine this with the ocaml library (mirage/ocaml-crunch) which allows to statically include a file. Hence, I would not need to have to install this python file somewhere, it would always be part of my ocaml executable! :) That would make the deployment of the executable super easy.
Sorry, I am writing a proper question now...