[Python-ideas] Determine Windows version in platform module

Skip Montanaro skip at pobox.com
Fri Dec 27 22:36:56 CET 2013


On Fri, Dec 27, 2013 at 3:09 PM, Andrew Barnert <abarnert at yahoo.com> wrote:
> So you want to write:
>
>     if platform.win_version_info >= (5, 1, 2600):
>
> Is that really much better than:
>
>     if platform.win32_ver.version >= '5.1.2600':

Once either of the first two numbers rolls over to two digits, the
first comparison will be correct, the second will not:

>>> x = '5.9.2600'
>>> y = '5.10.2600'
>>> y > x
False

Skip


More information about the Python-ideas mailing list