Python bridge for javascript on base SpiderMonkey
At this moment library does not support converting python variables to javascript variables and back. Use json.dumps
and JSON.parse
to communicate each other.
Installing
API
Usage
import pyjs
cx = pyjs.Context()
cx.eval('var a = 1')
import pyjs
cx = pyjs.Context()
cx.setGlobal("intVar", 1)
cx.setGlobal("object", {'type': 'someGlobalObject'})
cx.eval('intVar * 2')
Testing
- python setup.py test
Thanks
- Paul J. Davis (python-spidermonkey)
- Flier Lu (pyv8)