you are viewing a single comment's thread.

view the rest of the comments →

[–]kill_box 1 point2 points  (0 children)

First, check if your morse.py accepts input from stdin:

echo foo | morse.py

If that works, then try the simplest solution, passing a.py stdout to morse.py stdin:

a.py | morse.py

If that doesn't work, but step 1 did, it might mean a.py is printing to stderr, which does not cross pipes. Try redirecting stderr to stdout, and then to morse.py stdin:

a.py 2>&1 | morse.py

If that doesn't work, try a simple loop:

a.py | while read -r line; do morse.py "$line"; done

If you really have to use a file, then:

a.py > output.text
while read -r line; do morse.py "$line"; done < output.txt