erlportErlang port protocol | |
Download |
erlport Ranking & Summary
Advertisement
- License:
- BSD License
- Price:
- FREE
- Publisher Name:
- Dmitry Vasiliev
- Publisher web site:
- http://github.com/hdima/
erlport Tags
erlport Description
Erlang port protocol erlport is an Erlang port protocol for Python simplify interoperability between Erlang and Python. On the Python side write a processor object and pass it to erlport.PortProtocol like this:from erlport import PortProtocolclass Processor(object): def hello(self, name): return "Hello, %s" % nameif __name__ == "__main__": PortProtocol(Processor()).start()On the Erlang side function hello() can be called like this:-module(hello).-export().hello(Name) -> Port = open_port({spawn, "python hello.py"}, ), port_command(Port, term_to_binary({hello, Name})), receive {Port, {data, Data}} -> binary_to_term(Data) end.Test it in the Erlang shell:1> c(hello).{ok,hello}2> hello:hello("Bob")."Hello, Bob" Requirements: · Python
erlport Related Software