This works, but it seems too cute:

>>> pyver = map(int,sys.version.split()[0].split('.'))
>>> print(pyver)
[2, 6, 1]

Is it guaranteed that the Python version string will be in a form
suitable for that?  In other words, does "sys.version" begin

N.N.N other stuff

in all versions, and will it stay that way?  Are there ever
non-numeric versions, like "3.2.rc1"?

                                John Nagle
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to