Do we need to specify python interpreter externally if python script contains #!/usr/bin/python3?
<p>I am trying to invoke python script from C application using <code>system()</code> call</p>

<p>The python script has <code>#!/usr/bin/python3</code> on the first line.</p>

<p>If I do <code>system(python_script)</code>, the script does not seem to run.</p>

<p>It seems I need to do <code>system(/usr/bin/python3 python_script)</code>.</p>

<p>I thought I do not need to specify the interpreter externally if I have <code>#!/usr/bin/python3</code> in the first line of the script.</p>

<p>Am I doing something wrong?</p>

<p>Make sure you have executable permission for <code>python_script</code>.
You can make <code>python_script</code> executable by </p>

<p><code>chmod +x python_script</code></p>

<p>Also check if you are giving correct path for <code>python_script</code></p>

python c system interpreter