converting a ssh command to python
<p>I am trying to convert the below ssh command to python code,I was able to convert to python but the python code doesnt give any output,so i think i did not convert it properly especially the boolean "AND" logic..can anyone point what is wrong here?</p>

<pre><code>ssh -p 29418 company.com gerrit query --current-patch-set --commit-message --files 'status:open project:platform/code branch:master label:Developer-Verified=1 AND label:Code-Review&gt;=1'
</code></pre>

<p>Python code:-</p>

<pre><code>with open(timedir + "/ids.txt", "wb") as file:
    check_call("ssh -p 29418 company.com "
        "gerrit query --commit-message --files --current-patch-set "
        "status:open project:platform/code branch:master label:Developer-Verified=1 AND label:Code-Review&gt;=1 |"
        "grep refs |"
        "cut -f4 -d'/'",
            shell=True,   # need shell due to the pipes
            stdout=file)  # redirect to a file
</code></pre>
