views:

186

answers:

2

What is an easy (to implement) way to check whether I am on Windows Vista or Windows Server 2008 from a Python script?

platform.uname() gives the same result for both versions.

+2  A: 

see this previous question (and answer):

http://stackoverflow.com/questions/196930/how-to-check-if-os-is-vista-in-python

jcoon
+2  A: 

As mentioned in the other question the foolproof (I think) way is to use win32api.GetVersionEx(1). The combination of the version number and the product type will give you the current windows platform you're running on. Eg. the combination of version number "6.*" and product type VER_NT_SERVER is Windows Server 2008.

You can find information about the different combinations you can get at msdn

dagvl
I assume you typo'd and meant "win32api.GetVersionEx(1)".
Deestan