4

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

2
  • 1
    What? Javascript is part of a web page download? What do you mean "javascript from Python"? What are you doing? Commented 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) Commented Nov 19, 2009 at 17:05

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

Comments

1

You could call SpiderMonkey.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.