集成Python和JavaScript的最佳方式? [英] Best way to integrate Python and JavaScript?

查看:407
本文介绍了集成Python和JavaScript的最佳方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以集成Python和JavaScript?例如,假设您希望能够在JavaScript中定义类并从Python中使用它们(反之亦然)。如果是这样,最好的方法是什么?我不仅对这是否可行感兴趣,而且如果任何人在严肃的项目或产品中做到了

Is it possible to integrate Python and JavaScript? For example, imagine you wanted to be able to define classes in JavaScript and use them from Python (or vice versa). If so, what's the best way? I'm interested not only if this is possible but if anyone has done it within a "serious" project or product.

我是猜测可以使用 Jython Rhino ,举个例子,但我很好奇是否有人真的这样做了,以及是否有其他平台的解决方案(特别是 CPython )。

I'm guessing it would be possible using Jython and Rhino, for one example, but I'm curious whether or not anyone's ever actually done this, and if there are solutions for other platforms (especially CPython).

推荐答案

这是一个关于SeaMonkey Javascript解释器的Python包装器...... http://pypi.python。 org / pypi / python-spidermonkey

Here's something, a Python wrapper around the SeaMonkey Javascript interpreter... http://pypi.python.org/pypi/python-spidermonkey

这篇关于集成Python和JavaScript的最佳方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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