I am new to Python. I am struck up with the below problem.
I have called an exe using subprocess.check_output from my python script.
res = subprocess.check_output(["svn.exe", "list", "Https://127.0.0.1:443/svn/Repos"], stderr=subprocess.STDOUT)
when the script is executed in command prompt, i get a prompt message to enter an input,
(R)eject, accept (t)emporarily or accept (p)ermanently?
But when i execute the script from a batch file, i dont get this message and by default the call check_output fails.
Is there any way to pass the input while calling subprocess.check_output, so that i could run the script in batch.
Hi, Im updating my question:
I tried to run svn from command prompt with the below command,
echo t | svn.exe list Https://127.0.0.1:443/svn/Repos
I got the output without any user input.
But i couldnt able to pass the echo t | in subprocess.check_output.
Is there any way to do this?
Please help me to resolve this.
Thanks
I found two solutions for my problem,
1.found this soultion from this link http://desipenguin.com/techblog/2009/01/13/fun-with-python-subprocessstdin/
This resolved providing key input ‘t’ to the process. But i was not able to read the output. So, i followed the second solution.
2.Using two subprocesses:
Here the output of process 1 is given as input of process 2. So this is equal to
echo t | svnmucc mkdir d:\temp.Thanks.