I have a command (Say foo) that I normally run from terminal like so:
user@computer$ foo
enter the string: *(here I enter some string)*
RESULT OF THE COMMAND WITH THE GIVEN INPUT
I know beforehand what input I need to give. So, how do I automate the call using this python code:
from subprocess import call
call(['foo'])
How do I automate the input to foo ?
call([input('Enter the string')])in Python 3.x, orcall([raw_input()])for Python 2.x