In speaker.pyI use printto output text to STDOUT:
import time
while True:
time.sleep(1)
print("hello")
And in listener.pyI use inputto read from STDIN:
while True:
line = input()
if not line:
break
print(line)
I am trying to connect these two scripts to a channel:
python speaker.py | python listener.py
But listner.pyit doesn’t display anything.
What's wrong?
source
share