简体   繁体   English

如何在 Python 脚本中使用来自 nodejs 模块的 function

[英]How to use a function from a nodejs module inside a Python script

I need to use a function from a nodejs library ( import { signLimitOrder } from '@sorare/crypto'; ) from a Python script.我需要使用 Python 脚本中的 nodejs 库中的 function( import { signLimitOrder } from '@sorare/crypto'; )。 Is there a way to do such a thing?有没有办法做这样的事情?

I am trying to use the subprocess python library in order to launch a node command, but I am not sure if that is the best approach我正在尝试使用subprocess进程 python 库来启动节点命令,但我不确定这是否是最佳方法

Sure, subprocess module will work.当然,子流程模块可以工作。

Or you could run a REST / gRPC server from Node and communicate with that或者你可以从 Node 运行一个 REST / gRPC 服务器并与之通信

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM