cjen07

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

michalmuskala

Here’s a great article on ports: The Erlangelist - Outside Elixir

It uses Ruby, not Python, but the general approach should be exactly the same.

NobbZ

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

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>>

Last Post!

micahrye

micahrye

Thanks @NobbZ, @sasajuric, @OvermindDL1, community always rooks!

Where Next?

Popular in Questions Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement