Python 转 JavaScript PythonJS

码农软件 · 软件分类 · 编译器 · 2019-12-08 16:59:30

软件介绍

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

本文地址:https://codercto.com/soft/d/20712.html

JavaScript and Ajax for the Web, Sixth Edition

JavaScript and Ajax for the Web, Sixth Edition

Tom Negrino、Dori Smith / Peachpit Press / August 28, 2006 / $24.99

Book Description Need to learn JavaScript fast? This best-selling reference’s visual format and step-by-step, task-based instructions will have you up and running with JavaScript in no time. In thi......一起来看看 《JavaScript and Ajax for the Web, Sixth Edition》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具