Page 1 of 1

Ability to select python runtime for the script file

Posted: August 5th, 2020, 8:07 am
by elurin
Currently the post processing script file option does not allow for selecting the python runtime for the post processing.
I can change the default python binding from Python 2 to 3 on the OS, but if there are two scripts and one is in Python 3 and the other in 2 then it won't work. Also this can cause issues for other applications.

Is there anyway to change this in a configuration file?

Re: Ability to select python runtime for the script file

Posted: August 5th, 2020, 8:11 am
by sander
Can't you steer it via the shebang in the first line of the python script?

Re: Ability to select python runtime for the script file

Posted: August 5th, 2020, 8:26 am
by elurin
Misunderstood it at first, I have added to make it work #!/usr/bin/python3

Re: Ability to select python runtime for the script file

Posted: August 5th, 2020, 8:35 am
by safihre
Indeed what Sanderjo says. We don't select interpreters, we just run the file by simply calling it's path.
It's the shebang that selects the interpreter.
Only on Windows we prepend "python" in front of it, since it doesn't support shebangs.

Re: Ability to select python runtime for the script file

Posted: August 5th, 2020, 8:44 am
by sander
elurin wrote: August 5th, 2020, 8:26 am Could do that, but it is not ideal.
Why not? Only the script itselfs knows what it needs: python2 or python3.

Re: Ability to select python runtime for the script file

Posted: August 5th, 2020, 8:53 am
by elurin
sander wrote: August 5th, 2020, 8:44 am
elurin wrote: August 5th, 2020, 8:26 am Could do that, but it is not ideal.
Why not? Only the script itselfs knows what it needs: python2 or python3.
Yes, changed my answer, misunderstood what was meant with shebang.