安装
pip install js2py
示例
# -*- coding: utf-8 -*- import js2py js2py.eval_js('console.log("Hi")') # 'Hi' add = js2py.eval_js('function add(a, b){return a + b}') print(add(1, 2)) # 3
安装
pip install js2py
示例
# -*- coding: utf-8 -*- import js2py js2py.eval_js('console.log("Hi")') # 'Hi' add = js2py.eval_js('function add(a, b){return a + b}') print(add(1, 2)) # 3