[Python-talk] recognizing XP systems

Petr Kodl petrkodl at verizon.net
Mon Apr 17 17:39:52 EDT 2006


this is interpretation of first two numbers from sys.getwindowsversion()

assume

ver = sys.getwindowsversion()

ver[0] - major version
Operating System Meaning
Windows 95 4
Windows 98 4
Windows Me 4
Windows NT 3.51 3
Windows NT 4.0 4
Windows 2000 5
Windows XP 5
Windows Server 2003 family 5

ver[1] - minor version
dwMinorVersion
Minor version number of the operating system. This member can be one of 
the following values. Operating System Meaning
Windows 95 0
Windows 98 10
Windows Me 90
Windows NT 3.51 51
Windows NT 4.0 0
Windows 2000 0
Windows XP 1
Windows Server 2003 family 2


Lloyd Kvam wrote:
> I also had an email from Petr Kodl which I don't see here, but he
> recommended 
> 	sys.getwindowsversion
> 
> which apparently breaks apart the version string for easier processing.
> 
> 
> On Mon, 2006-04-17 at 17:06 -0400, Lloyd Kvam wrote:
> 
>>On Mon, 2006-04-17 at 15:58 -0400, Bill McGonigle wrote:
>>
>>>On Apr 17, 2006, at 14:39, Ray Cote wrote:
>>>
>>>
>>>>Try platform.uname()
>>>>Returns a tuple, third element of which says 'XP' and fourth element 
>>>>of which is 5.1.2600 (at least on my machine).
>>>>--Ray
>>>
>>>Bugger.  On 2k3:
>>>
>>>('Microsoft', 'vm2k3', 'Windows', '5.2.3790', '', '')
>>
>>That is unfortunate, but not an issue for the moment.  Right now I only
>>need correct behavior on desktops.  However, by the time I need to worry
>>about 2k3 or vista, all of the old win98 and ME machines may be gone.
>>
>>Perhaps I should be using [3], the version number.
>>
>>Thanks.
>>
>>>[1] is the machine name.  Maybe [3] is reliable?
>>>
>>>-----
>>>Bill McGonigle, Owner           Work: 603.448.4440
>>>BFC Computing, LLC              Home: 603.448.1668
>>>bill at bfccomputing.com           Cell: 603.252.2606
>>>http://www.bfccomputing.com/    Page: 603.442.1833
>>>Blog: http://blog.bfccomputing.com/
>>>VCard: http://bfccomputing.com/vcard/bill.vcf
>>>
>>>_______________________________________________
>>>Python-talk mailing list
>>>Python-talk at dlslug.org
>>>http://dlslug.org/mailman/listinfo/python-talk


More information about the Python-talk mailing list