开发者

How to execute Javascript from Python on Windows?

开发者 https://www.devze.com 2022-12-12 13:15 出处:网络
how can I execute Javascript from Python on Windows? I want to get python-spidermonkey functionality. Just like this:

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

精彩评论

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