从JavaScript转换为Python代码? [英] Conversion from JavaScript to Python code?

查看:114
本文介绍了从JavaScript转换为Python代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个相对较快的程序来完成至少这个基础知识?只有几个正则表达式?我愿意做一些手动转换,但这是一个非常大的脚本集。

Is there a relatively quick program out there to accomplish at least the basics of this? Just a few regexes? I'm willing to do some manual conversion, but this is a pretty big set of scripts.

推荐答案

更新了



现在好几(4)年后(几乎可以肯定)可以完成;虽然肯定没有RegEx。
我建议未来的读者看看 @Piotr Dabkowski的回答。
或其他一些答案。 (我不知道没试过)

Updated

Now several (4) years later this (almost certainly) can be done; though certainly not with RegEx. I suggest future readers look to @Piotr Dabkowski's answer.. Or some of the other answers. (I don't know having not tried them)

这是一个很难的。
编译器的定义从较高级语言转换为较低级语言。
例如python到机器代码。
或java到javascript(google在这个地方有一个相当着名的编译器 - 它'使谷歌doc更容易制作的东西'
Python到javascript编译器比比皆是。
技术上javascript to python将是一个反编译器。 (afaik)

Hm this is a hard one. The definition of a compiler is translates from a higher level language to a lower level language. eg python to machine-code. or java to javascript (google has a rather famous compiler for this somewhere - its' what makes google doc easier to make) Python to javascript compilers abound. technically javascript to python would be a decompiler. (afaik)

我发现了一些关于javascript-python转换器的猜测这里:按照说明进行操作。它主要讲的是如何做起来并不难。
我找不到任何东西,但这并不意味着它没有。

I found some speculation about a javascript-python converter here: follow the tread through. it mostly speaks of how it wouldn't be too hard to do. I can't find anything , but that doesn't mean it's no out there.

正则表达式不合适,正则表达式仅适用于常规语言。
编程语言通常不是常规语言。请参阅

Regex is not suitable, regex is suitable only for regular languages. programming languages are not normally regular languages. see this

这篇关于从JavaScript转换为Python代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆