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
-
1What? Javascript is part of a web page download? What do you mean "javascript from Python"? What are you doing?S.Lott– S.Lott2009年11月19日 16:51:14 +00:00Commented Nov 19, 2009 at 16:51
-
If you want to get python-spidermonkey functionality, why don't you use python-spidermonkey? (code.google.com/p/python-spidermonkey)Miguel Ventura– Miguel Ventura2009年11月19日 17:05:24 +00:00Commented Nov 19, 2009 at 17:05
2 Answers 2
How about pyv8: http://code.google.com/p/pyv8/
Sign up to request clarification or add additional context in comments.
Comments
You could call SpiderMonkey.
answered Nov 19, 2009 at 16:38
Quentin
949k137 gold badges1.3k silver badges1.4k bronze badges
Comments
default