I have lots of python scripts to be run and I want to automate them. All of them accept inputs at certain times (3 in this case). I have tried something like this but since echo does not have an EOF it did not work:
os.system("echo 4 | echo 5 | echo 6 | python script.py")
I cannot change the content of script.py and it does not accept arguments to it.
How can I automatically input using a line(s) of python code? Thanks.