how to pass "echo t | " input to subprocess.check_output() method

Kushal Kumaran kushal.kumaran+python at
Mon Nov 26 12:02:13 CET 2012

dachakku at writes:

> Hi all,
> I want to list the repositories in svn using python. For this i have used below command,
> " res = subprocess.check_output(["svn.exe", "list", "Https://"], stderr=subprocess.STDOUT) "
> but it throws an exception, since it requires an user input to validate certificate,
> " (R)eject, accept (t)emporarily or accept (p)ermanently? "
> from Command prompt im able to pass the input while calling the process, and im able to get the output
> "echo t | svn list Https://"
> But i dont know how to pass the "echo t | " in subprocess.check_output while calling a process.
> Is there a way to do this?
> Please help.

You could pass in a stdin argument to subprocess.check_output with a
value of 't\n'.

However, you might want to use something like,
which is a python library for accessing subversion repositories.


More information about the Python-list mailing list