faqts : Computers : Programming : Languages : Python : Common Problems

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 8 people (100%) answered Yes
Recently 4 of 4 people (100%) answered Yes

Entry

Is there a way to differentiate between WinNT and Win9x using Python?

Jun 26th, 2000 21:23
unknown unknown, Alex Martelli


import win32api
win32api.GetVersionEx()

will return, e.g., the tuple:

(4, 0, 1381, 2, 'Service Pack 5')


The 4th element in the tuple ("2" here) has the specific info you 
require; it's 1 for Win/95 and Win/98, 2 for Win/NT.