pyv8学习python和javascript变量进行交互

1217次阅读  |  发布于5年以前

python取得javascript里面的值

复制代码 代码如下:

import PyV8

with PyV8.JSContext() as env1:
env1.eval("""
var_i = 1;
var_f = 1.0;
var_s = "test";
var_b = true;
""")
vars = env1.locals
var_i = vars.var_i
print var_i

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8