return a value from python to php(shell and sys.exit)
<p>I have the next problem :
there is a python script which is called in php like this :</p>

<pre><code>exec($hwnumbercmd,$output,$return_value);
</code></pre>

<p>I use <code>sys.exit(0)</code> and <code>sys.exit(2)</code> in python.</p>

<p>As I know <code>$return_value</code> should contain '0' or '2',depending on the return of python script.
But I always get as return value '1'.
I dont understand why.</p>

<p>I read this,so I think it should work : </p>

<p><em>The optional argument arg can be an integer giving the exit status (defaulting to zero), or another type of object. If it is an integer, zero is considered “successful termination” and any nonzero value is considered “abnormal termination” by shells and the like.</em></p>
