Skip to content

nullie/python-hemi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-hemi

Synopsis

Hemi is a way to execute Javascript code from Python. It uses Google's V8.

Example usage

>>> import hemi
>>> ctx = hemi.Context()
>>> ctx.eval('2 + 3')
5
>>> ctx.eval('foo = 34')
34
>>> ctx.locals.foo
34
>>> ctx.eval('function test() { return this.toString() }')
<hemi.Undefined object at 0x7fcdab78d260>
>>> ctx.locals.test()
u'[object global]'
>>> ctx.locals.test.apply('hello!')
u'hello!'

Bugs

  • None yet known.

Todo

  • new operator.