-
You will need the following installed (which can be done automatically by running
./setup.sh):- pytest
- cmake
- doxygen
- python3-dev (python-dev)
- graphviz
- gcovr
- llvm
- rust
- python3.9 or later
- spidermonkey 102.2.0 or later
-
Compile pythonmonkey in
/build(which can be done automatically by running./build_script.sh)
- Compile the project
- In the build folder
cdinto thetestsdirectory and runctest.Alternatively, from the root directory, run# From the root directory we do the following (after compiling the project) $ cd buid/tests $ ctest
./test_script.sh
After compiling the project in the build/src folder you will find a .so file named pythonmonkey.so. This is the shared object file that contains the pythonmonkey module.
If you wish to use the library you can simply copy the .so file into the directory that you wish to use python in.
# In the directory containg pythonmonkey.so
$ pythonPython 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pythonmonkey as pm
>>> hello = pm.eval("() => {return 'Hello from Spidermonkey!'}")
>>> hello()
'Hello from Spidermonkey!'