Write output to console and then read only errors if there are any using Python
<p>I have to execute a command which does a db import. I am performing this action using <code>subprocess.Popen</code>. </p>

<p>I have to write the output to console if there are no errors in the process.</p>

<p>If there are any errors in the process I have to read them and display a customiszed message based on the error.</p>