Steve He Steve He - 16 days ago 4x
C Question

Do we need to specify python interpreter externally if python script contains #!/usr/bin/python3?

I am trying to invoke python script from C application using


The python script has
on the first line.

If I do
, the script does not seem to run.

It seems I need to do
system(/usr/bin/python3 python_script)

I thought I do not need to specify the interpreter externally if I have
in the first line of the script.

Am I doing something wrong?


Make sure you have executable permission for python_script. You can make python_script executable by

chmod +x python_script

Also check if you are giving correct path for python_script