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.
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
subprocessmodule like you would with any other foreign executable.