I have a Python file which might have to support Python versions
< 3.x and > 3.x
2.6 or 3.2.x
For example, to check that you are running Python 3.x, use
import sys if sys.version_info < 3: raise "Must be using Python 3"
sys.version_info is the major version number.
sys.version_info would give you the minor version number.
In Python 2.7 and later, the components of
sys.version_info can also be accessed by name, so the major version number is