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
Using sys.version_info you can do a simple value test against it. For example if you only want to support version 2.6 or lower:
sys.version_info
import sys if sys.version_info > (2,6): sys.exit("Sorry, only we only support up to Python 2.6!")