您当前的位置: 首页 >  Python

彭世瑜

暂无认证

  • 1浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Python:JS2PY执行js代码

彭世瑜 发布时间:2021-03-18 18:30:02 ,浏览量:1

Github: https://github.com/PiotrDabkowski/Js2Py

安装

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
关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.0563s