views:

203

answers:

2

Hello, how can I execute Javascript from Python on Windows?

I want to get python-spidermonkey functionality. Just like this:

>>> class Foo:
...   def hello(self):
...     print "Hello, Javascript world!"
>>> cx.bind_class(Foo, bind_constructor=True)
>>> cx.eval_script("var f = new Foo(); f.hello();")
Hello, Javascript world!

I can't use python-spidermonkey, because it doesn't work in windows

+1  A: 

You could call SpiderMonkey.

David Dorward
It doesn't work in windows...
чувак
+1  A: 

How about pyv8: http://code.google.com/p/pyv8/

Caleb