Is there a standard way to make sure a python script will be interpreted by python2 and not python3? On my distro, I can use #!/usr/bin/env python2 as the shebang, but it se
You can use the autotools to pick a Python 2 interpreter. Here is how to do that. Guaranteeing a correct shebang may be tricky to do elegantly; here is one way to do that. It may be easier to simply have a light Bash wrapper script, wrapper.sh.in
that looks something like:
#!/bin/bash
PYTHON2="@PYTHON@" #That first link enables this autotool variable
"$PYTHON2" "$@" #Call the desired Python 2 script with its arguments
Call wrapper.sh
(after a ./configure
) like:
./wrapper.sh my_python2_script.py --an_option an_argument