Duktape wrapper

Python implementation

Python ctypes wrapper for duktape JavaScript interpreter

class hat.duktape.Interpreter

Bases: object

JavaScript interpreter

High-level python wrapper to duktape JavaScript interpreter.

Current implementation caches all function objects for preventing garbage collection.

eval(code)

Evaluate JS code

Parameters

code (str) – JS code

Returns

Any

get(name)

Get global value

Parameters

name (str) – global name

Returns

Any

set(name, value)

Set global value

Parameters
  • name (str) – global name

  • value (Any) – value