Python 转 JavaScript PythonJS
PythonJS 是一个用 Python 写的转换器,用来将 Python 代码转成快速的 JavaScript,可运行于 Node.js 平台上。PythonJS 的设计思路的快速和易于集成现有的 JavaScript 代码。使用方法:var pythonjs = require('python-js');
var pycode = "a = []; a.append('hello'); a.append('world'); print(a)";
var jscode = pythonjs.translator.to_javascript( pycode );
eval( pythonjs.runtime.javascript + jscode );JavaScript API:var pythonjs, output;
pythonjs = require('python-js');
output = pythonjs.translator.to_javascript( input );
output = pythonjs.translator.to_javascript_module( input );
output = pythonjs.translator.to_dart( input );
output = pythonjs.translator.to_coffee( input );
output = pythonjs.translator.to_lua( input );
pythonjs.runtime.javascript // runtime required by translator output
var pycode = "a = []; a.append('hello'); a.append('world'); print(a)";
var jscode = pythonjs.translator.to_javascript( pycode );
eval( pythonjs.runtime.javascript + jscode );JavaScript API:var pythonjs, output;
pythonjs = require('python-js');
output = pythonjs.translator.to_javascript( input );
output = pythonjs.translator.to_javascript_module( input );
output = pythonjs.translator.to_dart( input );
output = pythonjs.translator.to_coffee( input );
output = pythonjs.translator.to_lua( input );
pythonjs.runtime.javascript // runtime required by translator output
没有找到相关结果
已邀请:
2 个回复
x雷春蓉
static/image/common/sigline.gif
90%打工小伙一生都不可能知道的秘密 http://11575.360kuyi.com/
x雷春蓉
static/image/common/sigline.gif
90%打工小伙一生都不可能知道的秘密http://user.qzone.qq.com/82175487