cjen07
Elixir call python by ports
Is there a way to call python using ports, and get the result by receive block?
Example code is preferred, thanks in advance.
Most Liked
michalmuskala
Here’s a great article on ports: http://theerlangelist.com/article/outside_elixir
It uses Ruby, not Python, but the general approach should be exactly the same.
NobbZ
There is no need in using the library, you are free to do all the work again and on your own, that has already been done by the ErlPorts team.
Perhaps you can show us what you have, and what you expect it to do and describe what it does instead. Maybe we can help you to fix it?
NobbZ
{:packet, 4} means, that you need 4 bytes denoting the lenght of the message and no newline after that (unless its part of the message).
In elixir syntax the message has to look like this:
<<4::integer-size(4)-unit(8), "asdf">>
# or
<<0, 0, 0, 4, 97, 115, 100, 102>>
micahrye
Thanks @NobbZ, @sasajuric, @OvermindDL1, community always rooks!







