Skip to content

mooreryan/pyml_bindgen_stickytape_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Stickytape + pyml_bindgen

One solution to this issue on pyml_bindgen GitHub.

Essentially, it is a way to embed multiple Python files/modules into your OCaml executable.

The py directory has some Python code. Two modules mathy and sparkles, with submodules. interface.py depends on both of them, and that is the file we want to generate bindings for with pyml_bindgen.

The problem is that we don't want to have to have the user of our OCaml program care about installing these modules we made. We want it all embedded. So the stickytape program is used to generate one python script with machinery to "roll up" everything needed into one file. Then this rolled up file is embedded in the OCaml code for pyml to use.

Checkout the dune file for the shell commands needed to set this all up.

Run the executable with dune exec ./yo.exe and the tests with dune runtest. After you build, feel free to move the generated executable to another directory, or another machine, it will work fine!

License

CC0

To the extent possible under law, Ryan M. Moore has waived all copyright and related or neighboring rights to this project.

If for whatever reason, CC0 will not work for your project, you may use MIT or the Unlicense.

About

Stickytape + pyml_bindgen

Resources

License

Unlicense and 2 other licenses found

Licenses found

Unlicense
UNLICENSE
CC0-1.0
LICENSE-CC0
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages