Описание тега pyv8
Оболочка Python для движка Google V8 JavaScript
PyV8 - это оболочка python для движка Google V8, она действует как мост между объектами Python и JavaScript и поддерживает размещение движка Google V8 в скрипте Python.
Пример:
>>> import PyV8
>>> ctxt = PyV8.JSContext() # create a context with an implicit global object
>>> ctxt.enter() # enter the context (also support with statement)
>>> ctxt.eval("1+2") # evalute the javascript expression
3 # return a native python int
>>> class Global(PyV8.JSClass): # define a compatible javascript class
... def hello(self): # define a method
... print "Hello World"
...
>>> ctxt2 = PyV8.JSContext(Global()) # create another context with the global object
>>> ctxt2.enter()
>>> ctxt2.eval("hello()") # call the global object from javascript
Hello World # the output from python script
- Домашняя страница: https://code.google.com/p/pyv8/