Thanks to python-spidermonkey
, using JavaScript code from Python is really easy.
However, instead of using Python to read JS code from a file and passing the string to Spidermonkey, is there a way to read the file from within Spidermonkey (or pass the filepath as an argument, as in Rhino)?