<pre><code>import subprocess
path = '/home/test/net.keystore
text = subprocess.Popen(['keytool', '-list', '-v', '-keystore', path], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
file = text.stdout.read().decode().splitlines()
print file
</code></pre>
<blockquote>
<p>through subprocess i trying to fetch keystore certificate details I
don't know password for keystore. If i press "enter key" twice then
output is processing</p>
<p>Is there any way to automate "Enter key" in python?</p>
</blockquote>