Note that there are some explanatory texts on larger screens.

plurals
  1. POPython - unable to call system command
    primarykey
    data
    text
    <p>I have some python code, from which I want to call another program. This program will</p> <ul> <li>Print some output to <code>STDOUT</code></li> <li>Write a file to disk</li> </ul> <p>Using <code>call</code> I get the following behavior;</p> <pre><code>from subprocess import call call(['./tango_x86_64_release', 'VTS1 ct="N" nt="N" ph="7.2" te="303" io="0.02" seq="MKHPYEEFPTGSKSPYNMSRGAHPGAV"']) 34, File not properly written, try writing it up again, 1 </code></pre> <p>This happens regardless if if the arguments are split into a list or not;</p> <pre><code>call(['./tango_x86_64_release', 'VTS1', 'ct="N"', 'nt="N"', 'ph="7.2"', 'te="303"', 'io="0.02"', 'seq="MKHPYEEFPTGSKSPYNMSRGAHPGAV"']) 34, File not properly written, try writing it up again, 1 </code></pre> <p>I can call this same command from the my terminal </p> <pre><code>./tango_x86_64_release VTS1 ct="N" nt="N" ph="7.2" te="303" io="0.02" seq="MKHPYEEFPTGSKSPYNMSRGAHPGAV" </code></pre> <p>Which works and gives an exit status of 0.</p> <p>It seems like its the writing to disk which is causing issues, if I break the command then I get the appropriate warning message (i.e. remove an argument, it warns me that the argument is missing).</p> <p>Using <code>subprocess.Popen()</code> gives an <code>OSError</code>;</p> <pre><code>import subprocess as sub output = sub.Popen('./tango_x86_64_release VTS1 ct="N" nt="N" ph="7.2" te="303" io="0.02" seq="MKHPYEEFPTGSKSPYNMSRGAHPGAV"', stdout=sub.PIPE, stderr=sub.PIPE) Traceback (most recent call last): File "&lt;stdin&gt;", line 1, in &lt;module&gt; File "/usr/lib64/python2.7/subprocess.py", line 679, in __init__ errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1249, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory </code></pre> <p>Any help greatly appreciated</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload