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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With