开发者

How can I call erlang from Python? [duplicate]

This question already has answers here: 开发者_StackOverflow Closed 9 years ago.

Possible Duplicate:

best way to integrate erlang and python

To use some powerful features of erlang, I should call erlang program from Python, How can I do that? Thank you~


In Erlang , you can communicate with the external world using ports which provides a byte oriented interface to the external program.

You can also have a look at erlport which is a python library implementing the Erlang port protocol.


Take a look at BERT-RPC. It allows you to perform remote procedure calls and casts, request data (including streaming). There you'll find various libraries for some languages including Python.

In your case you might just set up erlang server using ernie and communicate with it via python-bertrpc client. Both projects are documented.


We mostly use JSON over HTTP to do this. In some cases you might want to use a more robust messaging protocol (e.g. AMQP with RabbitMQ), but there's rarely a good reason for Python to directly speak the Erlang distribution protocol. Sometimes we use erlport to serialize things instead of JSON, when performance is a little more important.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜