在node.js中使用python模块 [英] Using python modules in node.js

查看:89
本文介绍了在node.js中使用python模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建一种胶水,从而使在node.js中使用python模块(更具体地讲,库绑定)成为可能?一些数据结构可以直接映射到V8对象-例如数组,字典.

Is it possible to create a glue that makes it possible for python modules (more specifically, library bindings) to be used in node.js? Some of the data structures can be directly mapped to V8 objects - e.g. array, dict.

更重要的是,与手动或通过FFI相比,这是一种创建绑定的更优雅的方法.简而言之,值得吗?

More importantly - would that be a more elegant way to create bindings than manually or through FFI. In short, would it be worth it?

推荐答案

尝试使用此node.js模块,它是一个桥梁: Node-Python

Try this node.js module, that is a bridge: Node-Python,

注意:该项目已有7年的历史了,仍然停留在v0.4上.仍然缺少许多功能,例如在Python和Node数组之间进行转换.可以安全地假定它不再受其原始作者的支持

NOTE: The Project is 7 years old and still stuck at v0.4. A lot of functionality like converting between Python and Node arrays is still missing. It may be safe to assume that it's no longer supported by its original author(s)

这篇关于在node.js中使用python模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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