Let say I have Erlang "enterprise application":
-module(hello).
-export([start/0]).
start() ->
spawn(fun() -> loop() end).
loop() ->
receive
hello ->
io:format("Hello, World!~n"),
loop();
goodbye ->
ok
end.
Is there a way to run it from Python code? So that I can get the "Hello, World!" text back to Python? Erlport seems to work the other way around..
EDIT: In other words how to bind to an Erlang port from Python?
What you are looking for is Py-Interface, it implements an Erlang compatible Node in Python.
The py_interface provides the possibility to create a node that may be used for communication with other Erlang nodes.
If you have a one-shot command line program that is written in Erlang and just want to execute it and capture the output, just use the subprocess module like you would with any other foreign executable.
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