### Navigation

- index
- modules |
- next |
- PyV8 v1.0beta documentation »

# Welcome to PyV8’s documentation!

PyV8 is a python wrapper for the Google V8 engine [1], it act as a bridge between the Python and JavaScript objects, and support to host the Google’s v8 engine in a python script.

You could create and enter a context to evaluate Javascript code in a few of code.

    >>> ctxt = 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 and return a native python int
    3

You also could invoke the Javascript function from Python, or vice versa.

    >>> class Global(JSClass):           # define a compatible javascript class
    ...   def hello(self):               # define a method
    ...     print "Hello World"
    ...
    >>> ctxt2 = JSContext(Global())      # create another context with the global object
    >>> ctxt2.enter()
    >>> ctxt2.eval("hello()")            # call the global object from javascript
    Hello World

- Introduction
- Build and Install
  - Build Steps
  - Third Party Library
  - Debug Mode
  - FAQ
- One Minute Tutorial
- Five Minute Tutorial
- Samples
- Public API
  - Javascript Context
  - Javascript Engine
  - Interoperability
  - Multi-Thread and Lock
  - Debugger and Profiler
  - Javascript AST (Abstract Syntax Tree)
- Internal
  - Object Lifecycle and GC (Garbage Collection)
- Frequently Asked Questions

# Indices and tables

- Index
- Module Index
- Search Page

Footnotes

[1] | Google V8 is Google’s open source JavaScript engine. V8 is written in C++ and is used in Google Chrome, the open source browser from Google. V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or ARM processors. V8 can run standalone, or can be embedded into any C++ application.

### Navigation

- index
- modules |
- next |
- PyV8 v1.0beta documentation »