Hi all:
I have the following python code that outputs the right value while in iex, but I don’t get the output with same code in Livebook. I think it is something to do how stdout is set up, but I need help.
In iex, I get the following:
iex(1)> Port.open({:spawn, "python3 /Users/gani/Desktop/test.py 20 1000"}, [:binary])
#Port<0.5>
iex(2)> flush()
{#Port<0.5>, {:data, "1573.1203851047762\n"}}
:ok
But the same code in Livebook gives me:
Port.open({:spawn, "python3 /Users/gani/Desktop/test.py 20 1000"}, [:binary]) #=> #Port<0.18>
flush() #=>** (CompileError) #cell:1: undefined function flush/0 (there is no such import)
What do I need to do to fix this?
Thanks,
Gani -