开发者

How to execute Javascript from Python on Windows?

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 win开发者_JAVA百科dows


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


You could call SpiderMonkey.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜