script stdout comparison in Python
<p>I have a program which tries to use the output of another script to decide what to do. </p>

<p>I take in the <code>stdout</code> of a Python process from an SSH session, the output of which is either <code>"Verified"</code> or <code>"Unverified"</code>, which appears on the command line when I print it as <code>['Verified\n']</code>.</p>

<p>My code is below. First I read in the output, then print it, then try to compare it. However it always comes out as the second option, that a does not equal verified - even when it should. Perhaps there is something I am missing about <code>stdout</code>, but I have tried many variations of the <code>(if a == )</code> condition, including with the brackets I listed above. I'm not sure why it doesn't work at all.</p>

<pre><code>stdin, stdout, stderr = ssh.exec_command("python verify.py")

a = stdout.readlines()
print a

if (a == "Verified"):
    print ("a does equal verified")
else:
    print ("a does not equal verified")
</code></pre>
