My favorites | Sign in
Project Logo
             
People details
Project owners:
  semanticist

pyjscore embeds a JavaScript environment into python, based on Apple's JavaScriptCore (from WebKit).

Features

Future

Sample

>>> import jscore
>>> c = jscore.Context()
>>> Math = c.globalObject.Math
>>> Math.sin(Math.PI/2) + 3
4.0
>>> def print_(*args): 
...     for x in args[:-1]: print x,
...     print args[-1]
... 
>>> c.globalObject['print'] = print_
>>> c.eval('''
... function hello(name) {
...   print('Hello,', name + '!');
... }
... ''')
>>> c.globalObject.hello('world')
Hello, world!








Hosted by Google Code