I want to run terminal command from python script. I know I can use os.system()
call. But problem here is when I run first command I get a prompt in which I have to write next terminal command. For example:-
./distance vectors_bow.bin
Enter word or sentence (EXIT to break): EXIT
I tried to use os.system('./distance vectors_bow.bin & EXIT')
but I get output sh: 1: EXIT: not found
.
It works fine when I do the above process manually in terminal but not from python script. How to do it?